从多个Web引用共享数据类型 [英] Sharing data types from multiple Web References

查看:170
本文介绍了从多个Web引用共享数据类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设供应商提供了两个独立的Web服务,这两者共享相同的数据类型和相同的命名空间。

Say a vendor has provided two separate webservices, which both share the same data types and same namespace.

例如。 下面web服务都包含相似的对象,例如一个TestCredentials对象

e.g. The following webservices both contain similar objects, such as a TestCredentials object:

  • TestWebservice / Testwebservice1.asmx
  • TestWebservice / Testwebservice2.asmx

这包括将使用Web引用我结束了与Visual Studio:

Including these into Visual Studio using web references I end up with:

  • Testwebservice1.TestCredentials
  • Testwebservice2.TestCredentials

当我真正想要的是:

  • Testwebservice.TestCredentials

有没有办法在Visual Studio中,当与Web引用处理,这两个Web服务连接在一起,这样生成的代理类是相同的(和相同的命名空间内)?

Is there any way in Visual Studio, when dealing with the web references, to link these two webservices together so that the proxy classes that are generated are the same (and within the same namespace)?

推荐答案

另一种可能的选择(还有Wsdl.exe用/ sharetypes)是使用Visual Studio 2008,并使用添加服务引用。在添加服务引用对话框中提供的选项重用类型。

Another possible option (along with wsdl.exe /sharetypes) is to use Visual Studio 2008 and use "Add Service Reference". The "Add Service Reference" dialog provides options to reuse types.

这篇关于从多个Web引用共享数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆