我怎么不叫Web引用一个web服务? [英] How do I call a webservice without a web reference?
问题描述
我要调用Web服务,但我不知道该URL,直到运行时。
I want to call a web service, but I won't know the url till runtime.
请告诉我获得在Web引用,实际上并没有提交到网址的最佳方式。
Whats the best way to get the web reference in, without actually committing to a url.
怎么样有1客户打相同的Web服务上说,10个不同的领域?
What about having 1 client hit the same web service on say 10 different domains?
推荐答案
创建Web引用,Web服务转换为动态Web服务。动态Web服务允许您修改URL。
Create the web reference, and convert the web service to a dynamic web service. A dynamic web service allows you to modify the Url.
您现在需要创建Web引用,以确保您的应用可以理解的界面上。通过切换到动态Web服务,您可以再修改.URL属性已初始化Web引用您的code后。
You need to create the web reference now to ensure your application understands the interfaces available. By switching to a dynamic web service you can then modify the .Url property after you have initialised the web reference in your code.
service = new MyWebService.MyWebService();
service.Url = myWebServiceUrl;
这篇关于我怎么不叫Web引用一个web服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!