开发者

WebService Reference for a Service I Have No Access To

I have a webservice that's not exposed thr开发者_如何学运维u the web. How can I access the webservice thru .net? Do I need to put the path to the server? I have three options in my solution? Which is the way that I have to go to access the service?

  1. Add Reference
  2. Add web reference
  3. Add Service Reference


You need to use Add Web Reference

I hope you know how to do it furthur. When selecting "Add Web Reference", it would ask for the Webservice URI.

Here is the difference between Web Reference and Service Reference


If the web service is running on .NET developement server, it would be something like http://localhost:3013/WebService.asxm

If it is hosted on IIS, it would be something like http://localhost/WebService


Actually, you should use "Add Service Reference" if possible. "Add Web Reference" uses the ASMX technology which Microsoft now considers to be "legacy technology".

When you use that command, pass it the path to the WSDL file for the service. Ordinarily, the path would be the path to a URL, like http://services.company.com/service.svc?wsdl. However, since you say the service is not on the net, they'll have to give you the WSDL. You can then simply supply the path to where the wsdl file is located on your disk.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜