iEntry 10th Anniversary RSS Newsletter Advertising
Visit Twellow.com
Text: Decrease Font Size Increase Font Size | Print Print Article | Share: Delicious Digg StumbleUpon Post to Twitter Post to Facebook
Tuesday, October 31, 2006

Use the SoapDocumentMethod Attribute to Speed Up Web Services

I've done a lot of web services during the last couple of years and I simply love Service Oriented Architecture using SOAP.

The power of using services as a means to create large connected systems are enormous but sometimes it can be a performance bottleneck.

The SOAP protocol in ASP.NET is defined as a response/request operation even if the method returns a void type.

That means that the requesting client waits until it gets a response from the web service and that can take a relative long time.

For simple logging applications or other simple SOAP calls where you aren't interested in waiting for the response, you can achieve performance gains by using the SoapDocumentMethod attribute on the web service methods.

What it does is that it instantly returns HTTP status code 200 OK to the requesting client, so it doesn't have to wait for the entire request to finish processing and it's built directly into the ASP.NET engine. Here is how to do it:

[WebMethod, SoapDocumentMethod(OneWay = true)]

public void LogError(string errorMessage)

{

DoSlowOperation(errorMessage);

}

It's not exactly rocket science but it can remove a potential bottleneck.

Tag:

Add to Del.icio.us | Digg | Reddit | Furl

Bookmark WebProNews:

Mads Kristensen currently works as a Senior Developer at Traceworks located
in Copenhagen, Denmark. Mads graduated from Copenhagen Technical Academy with a multimedia degree in
2003, but has been a professional developer since 2000. His main focus is on ASP.NET but is responsible for Winforms, Windows- and
web services in his daily work as well. A true .NET developer with great passion for the simple solution.

http://www.madskristensen.dk/

About the author:
Mads Kristensen currently works as a Senior Developer at Traceworks located in Copenhagen, Denmark. Mads graduated from Copenhagen Technical Academy with a multimedia degree in 2003, but has been a professional developer since 2000. His main focus is on ASP.NET but is responsible for Winforms, Windows- and web services in his daily work as well. A true .NET developer with great passion for the simple solution.

http://www.madskristensen.dk/

Hi Mads, After calling the

Hi Mads,

After calling the webservice method i want to redirect the page to homepage. In the webservice method i will generate an excel file, which takes some time. So as soon as the button is clicked. I will call the webservice method and redirect the user to homepage. Is this is possible here?

My code goes like this....

On Button_click

{

call webservice_method (to create the excel) //this takes some time

response.redirect("homepage.asp");

}

Your response is much appreciated.

Thanks in advance,

Venu (venugopal.n@hotmail.com)

Publish A Comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
3 + 2 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
SEARCH
Popular WPN Business Resources












Subscribe to WebProNews


Send me relevant info