如何通过asp .net在另一台机器上调用webservice? [英] How to call webservice through asp .net which in another machine?
本文介绍了如何通过asp .net在另一台机器上调用webservice?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
我在一台机器上有asp .net应用程序.我在另一台机器上有网络服务.说http://d01smc008/KlassAktIntegrationService/LMSService.asmx.
如何在asp .net中为此URL创建对象并在其中调用方法.
示例Hello World.
问候
Jesu
Hi All
I have asp .net application in one machine. And i have webservice in another machine. say http://d01smc008/KlassAktIntegrationService/LMSService.asmx.
How to create object for this url in asp .net and call the methods inside.
Example Hello World.
Regards
Jesu
推荐答案
只需右键单击您的项目,然后为该URL添加服务引用.如果您的计算机看不到它,则可能必须使用主机上的防火墙.
Just right click your project and add a service reference to that URL. If your computer can''t see it you might have to play with the firewall on the host computer.
或者您可以使用WSDL工具生成代理类
http://msdn.microsoft.com/en-us/library/7h3ystb6%28v = vs.71%29.aspx [ ^ ]
例如
启动.Net命令提示符
wsdl/out:C:\LMSServiceProxy.cs http://d01smc008/KlassAktIntegrationService/LMSService.asmx?WSDL
现在,您有了一个CS类,可让您访问Web服务
Or you can use the WSDL tool to generate you a proxy class
http://msdn.microsoft.com/en-us/library/7h3ystb6%28v=vs.71%29.aspx[^]
e.g.
Start .Net command prompt
wsdl /out:C:\LMSServiceProxy.cs http://d01smc008/KlassAktIntegrationService/LMSService.asmx?WSDL
You now have a CS class that lets you access the web service
我推荐这一类.
如何使您的Web参考代理URL动态化 [
I recommend this one.
How to make your Web Reference proxy URL dynamic[^]
这篇关于如何通过asp .net在另一台机器上调用webservice?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文