PDA

View Full Version : spring components as web services


robbo_b
01-30-2005, 11:38 PM
Hi,

I've worked on several projects now where we have used ASP.NET web services. One of the things I dislike is the need for a seperate .asmx file that contains the reference to the our web service implementation on the server and the lack of any hook that gives us some control over the instantiation and mapping of uris to web service implementations.

I was digging around trying to see wether or it would be possible to create a customised WebServiceHandlerFactory that instead of looking up the type from a .asmx file, did a lookup from a spring object factory based on the request uri, and then used the microsoft classes todo the rest of the soap serialisation/deserialisation. I would then map this handler factory to one of my own extensions i.e .sws

However, it appears all the microsoft classes needed to do all the normal soap processing are only visible to classes inside the System.Web.Services assembly, so that means my only other option is to implement all the soap stuff myself. It turns out the guys working on the mono project have finished porting asp.net web services stuff, so with their code, and a few minor modifications I was able to have my spring managed components exposed as web services, mapped to the *.sws extension.

I thought I'd mention this as I curious to see if anyway else knows of any other way to ave spring components exposed as web services.

rob

Mark Pollack
01-31-2005, 11:19 PM
Hi Rob

Interesting stuff....no other idea than what I had mentioned in the previous post, which doesn't touch on all the issues you raised anyway. Once we get this release out I'd like to look into it more. Can you post the code somewhere - our wiki is available if you like.

Cheers,
Mark

Aleks Seovic
04-06-2005, 05:59 AM
Hi Rob,

I remembered seeing your post few months back, so I thought it might be worth while to post reply in order to close the loop.

I checked functionality you are looking for into CVS this morning, which means that you'll need to get latest Spring.Web code from CVS in order to use it.

There is also a lot more there than what you were asking for, such as the ability to export any object as a web service, so creating a web service becomes a configuration, not implementation task.

Detailed docs for new web services features are on the wiki at http://opensource.atlassian.com/confluence/spring/display/NET/Web+Services+Support

- Aleks

robbo_b
04-06-2005, 01:18 PM
Hi Aleks,

Just had a look at the code in CVS. Looks good. I didnt realise the AOP stuff allowed you to do so much. Also It didnt occur to me to call a private method in the base class using reflection. I am curious how you found out the name of the method you needed to call though.

Rob

Aleks Seovic
04-06-2005, 01:29 PM
It's not really AOP stuff, just basic dynamic proxy generation :) New AOP implementation will build on it and add lot more stuff.

As for the method name, it's really easy to dig into .Net internals using Reflector.

BTW, I just finished client-side proxy implementation, so check that out as well. Just need to add the docs for it to wiki...

- Aleks