当前位置:编程学习 > wap >>

新人报道:在mobile模拟器下访问webservice的问题

现在遇到了两个问题,一个是在PocketPC 2003 Second Edition上访问自己建立的webservice 出了以下exception
位于 System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke()
位于 System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke()
at LoginRegister.Login()<-------这个是我写的webservice中的方法
位于 UniSmartGUI.Login.LoginForm.btnOK_Click()
位于 System.Windows.Forms.Control.OnClick()
位于 System.Windows.Forms.Button.OnClick()
位于 System.Windows.Forms.ButtonBase.WnProc()
位于 System.Windows.Forms.Control._InternalWnProc()
位于 Microsoft.AGL.Forms.EVL.EnterMainLoop()
位于 System.Windows.Forms.Application.Run()
位于 UniSmartMobile.Program.Main()

我已经用ActiveSync连接上了,模拟器也调了设置,启动后插在底座上(cradle)
然后webservice的ip也是我自己的ip了,不是localhost或者127.0.0.1,只是出异常的类是我用wsdl/sharetypes生成的,然后在编译时把所有编译出错误的地方注释掉了。

还有就是关于wsdl/sharetypes的问题,我现在想把该服务用于mobile设备,而服务器其中有的类是公用的,我不想自己写代码编码公用的自定义对象,因为对服务器端回改动很大,所以请大家帮忙解决下怎样才能在mobile端使用上wsdl/sharetypes出来的代码 --------------------编程问答-------------------- 什么错误信息。 说了半天,没有说什么错误的。


  
————————————————————————————————————
写作,虽然每个人都会查阅辞海,可,不是人人都能写出不朽的篇章的。编程,如是也。
--------------------编程问答-------------------- 就是在模拟器上抛出WebException

位于 System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke()
位于 System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke()
at LoginRegister.Login()<-------这个是我写的webservice中的方法
位于 UniSmartGUI.Login.LoginForm.btnOK_Click()
位于 System.Windows.Forms.Control.OnClick()
位于 System.Windows.Forms.Button.OnClick()
位于 System.Windows.Forms.ButtonBase.WnProc()
位于 System.Windows.Forms.Control._InternalWnProc()
位于 Microsoft.AGL.Forms.EVL.EnterMainLoop()
位于 System.Windows.Forms.Application.Run()
位于 UniSmartMobile.Program.Main()
--------------------编程问答-------------------- 就是对这句话的调用出的上述exception
return this.BeginInvoke("Login", new object[] {
                    username,
                    password,
                    device}, callback, asyncState);
这个我是用wsdl/sharetypes生成的,然后放到mobile的客户端,将所有编译不过的地方注释掉出现的 --------------------编程问答-------------------- 加一句话试试,如下

            WebReference.Service pdaWS = new WebReference.Service();

            pdaWS.Url = "http://192.168.1.146/Pda_service/Service.asmx";
    
            MessageBox.Show(pdaWS.HelloWorld());
补充:移动开发 ,  Windows Phone
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,