471,337 Members | 1,162 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

Asynchronous web service not getting kicked of.

I have a Web Service which I call ASynchronously. The problem its not
getting kicked off. This is how I am calling it over HTTP and after
calling the webservice I have a redirect to another page. I don't know
if that is allowed.

Here is how I call it on a click of a button.

COASTWebService.DeployService proxy = new
COASTWebService.DeployService();
IAsyncResult result;
result = proxy.BeginBuildPackage(deploymentID,
_currentPageParam.BranchID, null, null);
Session["IAsyncResult"] = result; //I really do not need this
Response.Redirect(string.Format("DeployStatus.aspx ?deployment_id={0}&branch_id={1}",deploymentID,_cu rrentPageParam.BranchID),true);
This is the web service code
namespace Composer.WebUI.COASTWebService {
using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;
/// <remarks/>
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]

[System.Web.Services.WebServiceBindingAttribute(Nam e="DeployServiceSoap",
Namespace="http://tempuri.org/")]
public class DeployService :
System.Web.Services.Protocols.SoapHttpClientProtoc ol {

/// <remarks/>
public DeployService() {
this.Url =
"http://localhost/COASTWebService/DeployService.asmx";
}

/// <remarks/>

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("http://tempuri.org/BuildPackage",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
public void BuildPackage(int deploymentID, int branchID) {
this.Invoke("BuildPackage", new object[] {
deploymentID,
branchID});
}

/// <remarks/>
public System.IAsyncResult BeginBuildPackage(int deploymentID,
int branchID, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("BuildPackage", new object[] {
deploymentID,
branchID}, callback, asyncState);
}

/// <remarks/>
public void EndBuildPackage(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
}
}
In the redirected page, on the LOAD of page this is what I do. I really
not do this as I constantly keep polling in the DB so I know the exact
state. But its just not happening.

if (Session["IAsyncResult"] != null)
{
COASTWebService.DeployService proxy = new
Composer.WebUI.COASTWebService.DeployService();
result = (IAsyncResult)Session["IAsyncResult"];
if (result.IsCompleted)
{
proxy.EndBuildPackage(result);
}
}

I am new to Async concept so please be easy...

Thanks

Feb 7 '06 #1
0 1016

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Matthew Groch | last post: by
1 post views Thread by Alexander Kaplunov | last post: by
8 posts views Thread by Simon Gorski | last post: by
33 posts views Thread by JamesB | last post: by
1 post views Thread by jan.loucka | last post: by

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.