Windows Mobile平台Web Service调试经验一则

来源:互联网 发布:网络开店卖虚拟 编辑:程序博客网 时间:2024/04/29 21:33

刚开始学习 Windows Mobile平台上的Web Service,结果在模拟器上调试程序总是通不过。最后,郁闷的发现Url属性不能用localhost,必须用机器名。

 

        private void button1_Click(object sender, EventArgs e)
        
{
            localhost.Service ws 
= new PPCClient.localhost.Service();
            
//这样写死活过不去,很奇怪
            
//ws.Url = "http://localhost/WebServiceDemo/Service.asmx";
            
//compaq-f76274c9是机器名
            ws.Url = "http://compaq-f76274c9/WebServiceDemo/Service.asmx";
            MessageBox.Show(ws.HelloWorld());
        }

写成localhost的时候在模拟器上用IE也可以打开服务的,不知道在程序里怎么就不行了,哪位高手指点一下。

原创粉丝点击