[SoapDocumentMethod(OneWay = true)]
Date: 03/17/08
(Asp Dot Net) Keywords: database, web
I am trying to create a "fire and forget" webservice that I can kick off from a webpage.
This is the code I have in the webservice:
using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Data;
[WebService(Namespace = "http://www.tempuri.org")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class TestWebService : System.Web.Services.WebService
{
public TestWebService()
{
//Uncomment the following line if using designed components
//InitializeComponent();
}
[SoapDocumentMethod(OneWay = true)]
[WebMethod]
public void MultipleDatabaseHits()
{
// ..... do a bunch of database stuff
}
}
When I launch it from a page using this code, the page doesnt complete loading untill the database work is done.
protected void Button1_Click(object sender, EventArgs e)
{
TestWebService mySvc = new TestWebService();
mySvc.MultipleDatabaseHits();
}
What am I doing wrong ?
I'm not using RPC for soap so I know that the [SoapDocumentMethod(OneWay = true)] command is the correct one to use. I've seen examples where [SoapDocumentMethod(OneWay = true)] came before or after [WebMethod] - I tried it in both places and it didnt make a difference.
Source: https://aspdotnet.livejournal.com/97095.html