3
A
回答
5
只需设置对象的Url属性调用任何的服务方法之前:
YourService service = new YourService();
service.Url = "http://some.other.url/";
// Now you're ready to call your service method
service.SomeUsefulMethod();
2
YourWebService service = new YourWebService();
service.Url = "http://www.example.com/YourWebService.asmx";
service.CallMethod();
6
我本来upvoted其他的答案中的一个 - 他们几乎是正确的。
using (YourService service = new YourService())
{
service.Url = "http://some.other.url/";
// Now you're ready to call your service method
service.SomeUsefulMethod();
}
如果未使用使用块,并抛出异常,则可能会泄露网络连接等资源。
相关问题
- 1. 在运行时更改Web服务URL
- 2. WCF在运行时在服务上设置绑定
- 3. Angularjs,在运行时设置价值服务的价值
- 4. 斜纹 - 在运行时更改代理服务器设置
- 5. 如何设置在线服务器的Java运行时环境
- 6. 在运行时设置xmlrpc.net服务网址
- 7. 在服务器上运行时为类设置参数
- 8. 在Eclipse中设置新的Red5服务器运行时
- 9. 如何设置服务器运行Node.js?
- 10. 长时间运行WCF服务的设置超时
- 11. Eclipse - 在“在服务器上运行”中选择服务器与设置“目标运行时”
- 12. 在Android中设置常量服务Url
- 13. System.Web.HttpException:在运行Web服务时无法执行URL,MVC3
- 14. 如何将WCF服务运行URL配置为SignalR url?
- 15. Android运行时位置服务权限
- 16. 如何在本地测试在运行时更改Azure服务配置设置?
- 17. WIX ServiceInstall - 设置网络服务下运行的服务帐户
- 18. 在运行时设置ConnectionString
- 19. 在运行时设置String.Format
- 20. 在运行时设置UICollectionViewCellSize
- 21. 在运行时设置XAML?
- 22. 设置symfony2运行时服务的方法调用
- 23. Tomcat - 不作为服务运行时设置工作目录
- 24. 在虚拟机上设置服务器TFS服务器url
- 25. 如何设置每次服务运行时WCF测试客户端将运行
- 26. 如何使用ATL库在运行时更改Web服务URL?
- 27. MVVM Web服务数据在设计时间和运行时间
- 28. Android服务正在运行,但它并未显示在设置 - >正在运行的服务
- 29. 运行长时间运行的服务
- 30. 从文件中设置web服务url