473,472 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

SOAP .Net client wrapper questions

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
5 3048
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Glauco | last post by:
I'm trying to use SOAPpy 0.10.1 for a client but is difficult to handle easly Is this library in use or i'm using an OLD death library ? I'm alone in find a lot of problem in a SOAP Client ?...
7
by: Mickel Grönroos | last post by:
Hi everybody, To the heart of the matter: Which of the available Soap modules is best fitted for client side soap messaging? I have an upload service (written in Perl) that I want to use from a...
0
by: RedHat_79 | last post by:
Hello everybody, I have already found a fair bit of information regarding on this group however I wouldn't mind expanding that a bit if possible. :) I am at the moment weighing my options in...
1
by: MR | last post by:
I am in dire need of help in trying to get the client code for a web service to work. i don't have a WSDL for the service so i created my own ASP.NET service to test with. i converted the DTD...
8
by: Dave A | last post by:
I have a class called 'PrimaryKey' that represents the primary key of a table. PrimaryKeys can only be created and the class only implements .ToString(). The PrimaryKey class internally stores...
3
by: JRey | last post by:
Does .Net generate the classes for Faults when they are specified in the WSDL. I tried defining them and then generating a proxy, and it did not appear to do it. On the Java side it did generate...
1
by: George Homorozeanu | last post by:
Hi, I programmed a WebService that has a function that takes an untyped DataSet as parameter and fills the data in a database. The WebService is programmed under .Net. Some guys are doing the...
2
by: Tarun Mistry | last post by:
Hi everyone, im in a position to create what is basically a manually web service, so instead of using the framework to auto generate SOAP messages, I will load "templates" from file, populate these...
15
by: =?Utf-8?B?ZG91Zw==?= | last post by:
I hadn't had a class yet and I had some MS help on this to set up, but I wrote a .Net WS that creates a proxy class response using SOAP. Works fine. And in kind of a good way, the IDE has hidden...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.