WEB SERVICE ,BeginInvoke异步调用,急在线等,立给分!

jingshong 2011-02-16 10:28:39
那位朋友对WEB SERVICE ,BeginInvoke异步调用比较熟,遇到奇怪问题WEBservice 正常,可以在IE手工调试下正常使用,但程序 BeginInvoke异步调用时,运行到BeginLogOn就直接跳走了,没有运行其下面的return ..运行代码如下:
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute(" http://localhost:19496/LogOn", RequestNamespace=" http://localhost:19496/", ResponseNamespace=" http://localhost:19496/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public int LogOn(string userid, string password, bool WriteDog) {
object[] results = this.Invoke("LogOn", new object[] {
userid,
password,
WriteDog});
return ((int)(results[0]));
}

/// <remarks/>
public System.IAsyncResult BeginLogOn(string userid, string password, bool WriteDog, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("LogOn", new object[] {
userid,
password,
WriteDog}, callback, asyncState);


pkman(124086091) 22:08:01
局部变量:

...全文
145 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
jingshong 2011-03-01
  • 打赏
  • 举报
回复
没人懂????。。。。
jingshong 2011-02-17
  • 打赏
  • 举报
回复
补充一下执行的代码:
上面的代码是WEB服务里的代码,下面是调用服务的客户端程序,每次大约label4.Text =2000左右时,ar.IsCompleted =TRUE;此时,rs.EndLogOn(ar), AR都仍然没有值。所以,调用失败。
int p = 1;
while (ar.IsCompleted ==false)
{
p++;
label4.Text = p.ToString();
label4.Refresh();
}
int rtn = rs.EndLogOn(ar);
if (rtn==0)
{
MessageBox.Show("登录失败!请检查用户名和密码输入是否正确。","提示", MessageBoxButtons.OK ,MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
label37.Text ="";
label37.Refresh();
}
else if (rtn==1){}
else
{
MessageBox.Show("服务器验证失败!请检查服务器配置是否正确。("+rtn.ToString()+")", "提示", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
label37.Text ="";
label37.Refresh();
}
hangang7403 2011-02-17
  • 打赏
  • 举报
回复
bangding....
xiaoqiu1234 2011-02-17
  • 打赏
  • 举报
回复
宝_爸 2011-02-17
  • 打赏
  • 举报
回复
遇到异常了?
jingshong 2011-02-17
  • 打赏
  • 举报
回复
运行调试时的局部变量和自动窗口的信息。
http://hi.csdn.net/attachment/201102/16/774212_1297887126HXR1.jpg
http://hi.csdn.net/attachment/201102/16/774212_1297887174YS3Z.jpg
wuyq11 2011-02-16
  • 打赏
  • 举报
回复
看一下eventlog里,有没有记录的错误信息
抓取分析看看

110,529

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧