By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,538 Members | 950 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,538 IT Pros & Developers. It's quick & easy.

SOAP .Net client wrapper questions

P: n/a
Hi...

I've got a .Net client to a soap service that works for the most part, but
there are a couple of things I'd like to improve:

1) the first request to the client wrapper always takes 12-15 seconds even
though the web server shows < a half second spent on the request. What takes
so much time for the client wrapper to warm up? All subsequent requests,
even to the same method, take the half second.

2) I tried using the async methods, but for some reason when I have 2
outstanding async web service requests one never registers as finished, even
though they both have different completion routines. What do I have to do to
get async calls to work?

Thanks
Mark

Aug 14 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi Mark,

From your description, you're encountering two problems:

1. the startup delay of 1st webservice call(at client proxy)
2. Async operation with the webservice (not work for more than 1 calls)

Regarding on the first issue, a common cause is the XML serialization
assembly's dynamic generation. From .NET 2.0/VS 2005, it support
pregenerate some XML serialization assembly for webservice client. You can
find the option in Visual studio project properties's "build-->generate
serialization assembly" section(in property dialog). Her are some reference
on this;

#Improving Performance of XML Serializers in .Net
http://eprystupa.wordpress.com/2008/...e-of-xml-seria
lizers-in-net/

#XML Serializer Generator Tool (Sgen.exe)
http://msdn.microsoft.com/en-us/libr...40(VS.80).aspx

Also, when using WCF client to call XML webservice, you'll also encounter
this startup preformance issue:

http://blogs.msdn.com/eugeneos/default.aspx

http://msdn.microsoft.com/en-us/library/aa751883.aspx

For the second async method call issue, would you provide some further
description and code snippet to demonstrate the problem scenario?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we

can improve the support we provide to you. Please feel free to let my
manager know what you think of

the level of service provided. You can send feedback directly to my manager
at: ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/en-us/subs...#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response

from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take

approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution.

The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump

analysis issues. Issues of this nature are best handled working with a
dedicated Microsoft Support

Engineer by contacting Microsoft Customer Support Services (CSS) at

http://support.microsoft.com/select/...tance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: =?Utf-8?B?TWFyaw==?= <mm******@nospam.nospam>
Subject: SOAP .Net client wrapper questions
Date: Thu, 14 Aug 2008 11:03:01 -0700
Hi...

I've got a .Net client to a soap service that works for the most part, but
there are a couple of things I'd like to improve:

1) the first request to the client wrapper always takes 12-15 seconds even
though the web server shows < a half second spent on the request. What
takes
so much time for the client wrapper to warm up? All subsequent requests,
even to the same method, take the half second.

2) I tried using the async methods, but for some reason when I have 2
outstanding async web service requests one never registers as finished,
even
though they both have different completion routines. What do I have to do
to
get async calls to work?

Thanks
Mark
Aug 15 '08 #2

P: n/a
Hi Steven...

Thank you for your suggestions. My program is written in the 2.0 framework,
so WCF and svcutil.exe don't apply. I did try manually executing sgen.exe
but it didn't help. I looked at my project under the build properties, and
found Generate serialization assemblies was set to "Auto" - but it wasn't
generating them. I set it to On and now the MyApp.XmlSerializers.dll is
getting generated, but it also doesn't appear to help. There's still an
extra ~12 seconds of overhead coming from somewhere.

Your point about the serializers sounds right, but for some reason the
XmlSerializers.dll doesn't seem to be helping.

On the async question, here's the code from my app:
//tm.WS.Method1Completed += new
Method1CompletedEventHandler(AsyncMethod1Completed );
//tm.WS.Method2Completed += new
Method2CompletedEventHandler(AsyncMethod2Completed );
//tm.WS.Method1Async();
//tm.WS.Method2Async();
//for (; meth1Result == null && meth2Result == null; )
// System.Threading.Thread.Sleep(50);
....
private void AsyncMethod1Completed(object sender, Method1CompletedEventArgs e)
{
this.meth1Result = e.Result;
Debug.WriteLine("Finished Executing Method1");
}

private void AsyncMethod2Completed(object sender, Method2CompletedEventArgs e)
{
this.meth2Result = e.Result;
Debug.WriteLine("Finished Executing Method2");
}

The problem is that the 2nd async call never comes back on the client side.
The web service says that it served both requests but the client
infrastructure never seems to notice that.

Any more ideas you have would be appreciated.

Thanks
Mark

Aug 15 '08 #3

P: n/a
Hi Steven...

I got to wondering - did you mean that the XmlSerializer had to be created
on the client side or the web service side? I tried turning generation on
for the web service and that didn't produce any result.

I found some other posts indicating that the problem may be with the
automatic Proxy setting detection, and that seems like it might be involved.
I enabled net tracing and found a couple of things:

1) the long delay does seem to have something to do with proxy; when it is
very slow, there's a long delay between HttpWebRequest::GetRequestStream()
and WebProxy failed to autodetect a Uri...

2) that failure seems to be cached for a little while, even across
processes. If I stop and restart the process immediately, and then hit the
same web service, I don't get the delay. But the cache setting of the proxy
detect appears somewhat short-lived. If I wait 30 seconds between process
starts, the first request is slow again.

3) When I code to the web request directly, I've disabled proxy setting
detects by setting HttpWebRequest.Proxy = null; but when I use WSClient
client = new WSClient();, it appears that it starts the proxy detect
immediately.

I can set client.Proxy = null; immediately after construction, but that
doesn't seem to help.

How do you disable proxy setting detection for a web service client?

Thanks
Mark
"Steven Cheng [MSFT]" wrote:
Hi Mark,

From your description, you're encountering two problems:

1. the startup delay of 1st webservice call(at client proxy)
2. Async operation with the webservice (not work for more than 1 calls)

Regarding on the first issue, a common cause is the XML serialization
assembly's dynamic generation. From .NET 2.0/VS 2005, it support
pregenerate some XML serialization assembly for webservice client. You can
find the option in Visual studio project properties's "build-->generate
serialization assembly" section(in property dialog). Her are some reference
on this;

#Improving Performance of XML Serializers in .Net
http://eprystupa.wordpress.com/2008/...e-of-xml-seria
lizers-in-net/

#XML Serializer Generator Tool (Sgen.exe)
http://msdn.microsoft.com/en-us/libr...40(VS.80).aspx

Also, when using WCF client to call XML webservice, you'll also encounter
this startup preformance issue:

http://blogs.msdn.com/eugeneos/default.aspx

http://msdn.microsoft.com/en-us/library/aa751883.aspx

For the second async method call issue, would you provide some further
description and code snippet to demonstrate the problem scenario?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we

can improve the support we provide to you. Please feel free to let my
manager know what you think of

the level of service provided. You can send feedback directly to my manager
at: ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/en-us/subs...#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response

from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take

approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution.

The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump

analysis issues. Issues of this nature are best handled working with a
dedicated Microsoft Support

Engineer by contacting Microsoft Customer Support Services (CSS) at

http://support.microsoft.com/select/...tance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: =?Utf-8?B?TWFyaw==?= <mm******@nospam.nospam>
Subject: SOAP .Net client wrapper questions
Date: Thu, 14 Aug 2008 11:03:01 -0700
Hi...

I've got a .Net client to a soap service that works for the most part, but
there are a couple of things I'd like to improve:

1) the first request to the client wrapper always takes 12-15 seconds even
though the web server shows < a half second spent on the request. What
takes
so much time for the client wrapper to warm up? All subsequent requests,
even to the same method, take the half second.

2) I tried using the async methods, but for some reason when I have 2
outstanding async web service requests one never registers as finished,
even
though they both have different completion routines. What do I have to do
to
get async calls to work?

Thanks
Mark

Aug 18 '08 #4

P: n/a
Hi Steven...

I think I figured it out. Setting WSClient.Proxy = null; didn't seem to be
stopping the auto-detect drag, so I replaced it with
WSClient.Proxy = new WebProxy("http://bogus.url:8888", true, new string[]
{myWebServiceUrl});

Basically, I gave it an instance of a proxy specifically designed to bypass
my web service url - and it seemed to help a lot.

Thanks
Mark
"Steven Cheng [MSFT]" wrote:
Hi Mark,

From your description, you're encountering two problems:

1. the startup delay of 1st webservice call(at client proxy)
2. Async operation with the webservice (not work for more than 1 calls)

Regarding on the first issue, a common cause is the XML serialization
assembly's dynamic generation. From .NET 2.0/VS 2005, it support
pregenerate some XML serialization assembly for webservice client. You can
find the option in Visual studio project properties's "build-->generate
serialization assembly" section(in property dialog). Her are some reference
on this;

#Improving Performance of XML Serializers in .Net
http://eprystupa.wordpress.com/2008/...e-of-xml-seria
lizers-in-net/

#XML Serializer Generator Tool (Sgen.exe)
http://msdn.microsoft.com/en-us/libr...40(VS.80).aspx

Also, when using WCF client to call XML webservice, you'll also encounter
this startup preformance issue:

http://blogs.msdn.com/eugeneos/default.aspx

http://msdn.microsoft.com/en-us/library/aa751883.aspx

For the second async method call issue, would you provide some further
description and code snippet to demonstrate the problem scenario?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we

can improve the support we provide to you. Please feel free to let my
manager know what you think of

the level of service provided. You can send feedback directly to my manager
at: ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/en-us/subs...#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response

from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take

approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution.

The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump

analysis issues. Issues of this nature are best handled working with a
dedicated Microsoft Support

Engineer by contacting Microsoft Customer Support Services (CSS) at

http://support.microsoft.com/select/...tance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: =?Utf-8?B?TWFyaw==?= <mm******@nospam.nospam>
Subject: SOAP .Net client wrapper questions
Date: Thu, 14 Aug 2008 11:03:01 -0700
Hi...

I've got a .Net client to a soap service that works for the most part, but
there are a couple of things I'd like to improve:

1) the first request to the client wrapper always takes 12-15 seconds even
though the web server shows < a half second spent on the request. What
takes
so much time for the client wrapper to warm up? All subsequent requests,
even to the same method, take the half second.

2) I tried using the async methods, but for some reason when I have 2
outstanding async web service requests one never registers as finished,
even
though they both have different completion routines. What do I have to do
to
get async calls to work?

Thanks
Mark

Aug 18 '08 #5

P: n/a
Hi Mark,

As for the xmlserializers assemblies, they're used for webservice client
proxy rather than server-side ASP.NET webservice. The client-side proxy
will need to generated some dynamic assemblies for xml serialization and we
can pregenerate them to improve performance.

Also, as you mentioned, you found that adjust the proxy setting helps much
on this. So the problem here is somewhat caused by the proxy detection(the
delay on initial request). For more information about configuring
proxy(via code or configuration), I suggest you have a look at the
following article:

#Proxy Detection Take the Burden Off Users with Automatic Configuration in
.NET
http://msdn.microsoft.com/en-us/magazine/cc300743.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: =?Utf-8?B?TWFyaw==?= <mm******@nospam.nospam>
References: <5E**********************************@microsoft.co m>
<f8**************@TK2MSFTNGHUB02.phx.gbl>
Subject: RE: SOAP .Net client wrapper questions
Date: Mon, 18 Aug 2008 09:45:01 -0700
Hi Steven...

I think I figured it out. Setting WSClient.Proxy = null; didn't seem to be
stopping the auto-detect drag, so I replaced it with
WSClient.Proxy = new WebProxy("http://bogus.url:8888", true, new string[]
{myWebServiceUrl});

Basically, I gave it an instance of a proxy specifically designed to bypass
my web service url - and it seemed to help a lot.

Thanks
Mark
"Steven Cheng [MSFT]" wrote:
Hi Mark,

From your description, you're encountering two problems:

1. the startup delay of 1st webservice call(at client proxy)
2. Async operation with the webservice (not work for more than 1 calls)

Regarding on the first issue, a common cause is the XML serialization
assembly's dynamic generation. From .NET 2.0/VS 2005, it support
pregenerate some XML serialization assembly for webservice client. You
can
find the option in Visual studio project properties's "build-->generate
serialization assembly" section(in property dialog). Her are some
reference
on this;

#Improving Performance of XML Serializers in .Net
http://eprystupa.wordpress.com/2008/...e-of-xml-seria
lizers-in-net/

#XML Serializer Generator Tool (Sgen.exe)
http://msdn.microsoft.com/en-us/libr...40(VS.80).aspx

Also, when using WCF client to call XML webservice, you'll also encounter
this startup preformance issue:

http://blogs.msdn.com/eugeneos/default.aspx

http://msdn.microsoft.com/en-us/library/aa751883.aspx

For the second async method call issue, would you provide some further
description and code snippet to demonstrate the problem scenario?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we

can improve the support we provide to you. Please feel free to let my
manager know what you think of

the level of service provided. You can send feedback directly to my
manager
at: ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/en-us/subs...#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
where an initial response

from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each
follow
up response may take

approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution.

The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump

analysis issues. Issues of this nature are best handled working with a
dedicated Microsoft Support

Engineer by contacting Microsoft Customer Support Services (CSS) at

http://support.microsoft.com/select/...tance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
>
--------------------
From: =?Utf-8?B?TWFyaw==?= <mm******@nospam.nospam>
Subject: SOAP .Net client wrapper questions
Date: Thu, 14 Aug 2008 11:03:01 -0700
Hi...

I've got a .Net client to a soap service that works for the most part,
but
there are a couple of things I'd like to improve:

1) the first request to the client wrapper always takes 12-15 seconds
even
though the web server shows < a half second spent on the request. What
takes
so much time for the client wrapper to warm up? All subsequent requests,
even to the same method, take the half second.

2) I tried using the async methods, but for some reason when I have 2
outstanding async web service requests one never registers as finished,
even
though they both have different completion routines. What do I have to
do
to
get async calls to work?

Thanks
Mark

Aug 20 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.