Spring for .NET Community Forums    

Go Back   Spring for .NET Community Forums > General > Remoting and Web Services

Reply
 
Thread Tools Display Modes
  #1  
Old 02-19-2008, 05:28 AM
kennethxu kennethxu is offline
Member
Spring User
 
Join Date: May 2007
Posts: 32
Default Slow startup with Web Service Client due to XmlSerializer

As we knew the slow startup problem caused by the XmlSerializer, is there anyway to pre-compile the serializer for spring generated the web proxy client? With sgen.exe or XGenPlus?

Any input is much appreciated.

-kennethxu
Reply With Quote
  #2  
Old 02-19-2008, 10:04 AM
Bruno Baia Bruno Baia is offline
Senior Member
Spring TeamSpring User
 
Join Date: Oct 2005
Location: Toulouse, France
Posts: 1,239
Default

Hi,

I don't see any problems with this.
Spring.NET does not generate dynamically domain types, only the proxy type.

Cheers,
Bruno
__________________
My english is as poor as my taylor is rich
Reply With Quote
  #3  
Old 02-19-2008, 05:56 PM
kennethxu kennethxu is offline
Member
Spring User
 
Join Date: May 2007
Posts: 32
Default

We are using SGen.exe to create pre-compiled XmlSerializer. It works for our domain object. But doesn't do it for those httpsoap proxy generated by spring.net. If we creates the .NET web service client. SGen sees it and pre-compiles them. I'm guessing may be related to those soap request and response objects. I'll try to get more information.
Reply With Quote
  #4  
Old 08-20-2008, 04:48 AM
kennethxu kennethxu is offline
Member
Spring User
 
Join Date: May 2007
Posts: 32
Default

As promised, although a bit late as this was not my top priority, I'm now back with more detail information as well as a solution for this.

http://kennethxu.blogspot.com/2008/0...springnet.html
Reply With Quote
  #5  
Old 08-20-2008, 05:13 AM
kennethxu kennethxu is offline
Member
Spring User
 
Join Date: May 2007
Posts: 32
Default

Quote:
Originally Posted by Bruno Baia View Post
Hi,

I don't see any problems with this.
Spring.NET does not generate dynamically domain types, only the proxy type.

Cheers,
Bruno
Hi Bruno,

SGen indeed generates the serializer for classes implement SoapHttpClientProtocol with WebServiceBindingAttribute set. When web service client is generated by the Spring.Net dynamic proxy, the temporary assembly was created by XmlSerializer in runtime. So the Spring.Net web service client indeed starts up much slower. See the link in my previous post for detail.

I guess the server side would have same problem but it is not such a big deal as the server is more tolerable to startup performance.

I'm looking into a solution to generate the source code at compile time instead of emit dynamic proxy at runtime.

Cheers,
Kenneth

Last edited by kennethxu; 08-23-2008 at 03:18 PM.
Reply With Quote
  #6  
Old 08-21-2008, 03:23 AM
swalters swalters is offline
Member
Spring User
 
Join Date: May 2006
Posts: 31
Default

Kenneth,

I've very glad to see you working on this. We just released v1.0 of our clickonce application with Spring.Net Web Service proxies and I am seeing the same thing. What's worse is that our v1.1 introduces more features with more webservices which will slow it down even more.

I'll keep a close eye on your progress.

-Shane
Reply With Quote
  #7  
Old 08-21-2008, 04:55 AM
kennethxu kennethxu is offline
Member
Spring User
 
Join Date: May 2007
Posts: 32
Default

Swalters,

Glod to know that I'm not along here. I was able to create the code generator, still trying to fiigure out a way to integrate with Visual Studio. Suggestions are welcome. See my blog for more detail:

http://kennethxu.blogspot.com/2008/0...b-service.html

Cheers!
Reply With Quote
  #8  
Old 08-21-2008, 10:55 AM
.ben .ben is offline
Senior Member
Spring User
 
Join Date: Oct 2005
Location: Belgium
Posts: 214
Default

I'm confronted with this as well, for now I've just been using a splash screen to get around it .
Reply With Quote
  #9  
Old 08-28-2008, 06:05 AM
kennethxu kennethxu is offline
Member
Spring User
 
Join Date: May 2007
Posts: 32
Default

Hello swalters and ben,

Sorry for keep you waiting. I had to take care my sick discuses that I just got from a local pet store by trading in our two huge 10 inch blood parrot cichlids. The blood parrots were too big to be in our 55 gal tanks.

OK, finally, I have an open source project setup at CodePlex (http://www.codeplex.com/WSCodeGen). You are very welcome to download the source code there and try it out. I have also updated my blog to include a step by step instruction with an example VS.Net solution.

Cheers,
Kenneth
Reply With Quote
  #10  
Old 08-31-2008, 03:31 PM
kennethxu kennethxu is offline
Member
Spring User
 
Join Date: May 2007
Posts: 32
Default

This problem is now resolved by replacing spring.net web service client proxy with http://www.codeplex.com/WSCodeGen. Our application used to create over 300 temp files by 43 web service client if I turn on the XmlSerializer diagnose. Now it generates 0 files.

There is a bug in ClickOnce deployment so that you shouldn't put the generated source file in the executable project. I had to create a special project to hold the generates source file and it worked fine for me. I'll write the detail in my next blog post.

I'm maintaining the XML manually now and looking into transforming from the spring config file. I won't update this thread form now on, but will post any future update in my blog.

Last edited by kennethxu; 08-31-2008 at 03:34 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:05 AM.


Contegix provides first-class managed hosting and partial sponsorship of these forums.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.