简体   繁体   English

如何从代码引用非现场Web服务

[英]How to reference an offsite web service from code

I have a .NET code which has a web reference to a web service (eg. WebRef) which resides in a corporate intranet (CorpInt). 我有一个.NET代码,该代码具有对位于公司Intranet(CorpInt)中的Web服务(例如WebRef)的Web引用。

The problem is I do not have access to CorpInt from my development machine. 问题是我无法从开发计算机访问CorpInt。 And the code has references which goes like 并且代码具有类似的引用

WebRef.Customers webref = new WebRefProxy.GetCustomersService();

Is there a way in which I could get in the remote intranet site, download something like a disconnected WebRef such that I can compile and reference it on my development machine? 有什么方法可以进入远程Intranet站点,下载断开的WebRef之类的东西,以便可以在开发计算机上进行编译和引用?

Or any other feasible solution? 还是其他可行的解决方案?

thank you in advance. 先感谢您。

You shoud try to improve your code design and implement a Service Stub , the fundamental objective of this pattern is resolve problems like your: 您应该尝试改善代码设计并实现Service Stub ,此模式的基本目标是解决类似您的问题:

Removes dependence upon problematic services during testing 在测试过程中消除对有问题的服务的依赖

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM