[英]Update WCF service reference to WebService issue in VS 2010
My current project is using VS 2010. I'm new to WCF. 我当前的项目是使用VS2010。我是WCF的新手。 I've consumed WebServices before but I've never had to generate the actual proxy. 我以前使用过WebServices,但是我从来不需要生成实际的代理。 The current project I'm working on using WCF service reference to call a web service. 我正在使用WCF服务参考来调用Web服务的当前项目。 Fairly simple and straightforward. 非常简单明了。 I've added a new service reference and everything worked perfectly on the initial setup. 我添加了一个新的服务参考,并且在初始设置中一切正常。
When the WSDL was updated, I simply right-clicked on the service reference and selected "Update Reference". 在更新WSDL时,我只需右键单击服务引用并选择“更新引用”。 After doing so, there are now duplicate object names with the number '1' appened. 这样做之后,现在将出现重复的对象名称,并带有数字“ 1”。 So for example: 因此,例如:
Initial generate from WSDL results: 根据WSDL结果初步生成:
GetWidget (getWidgetRequest)
GetWidgets (getWidgetRequest)
GetWidgetGroups (getWidgetRequest)
After updating, I now have this: 更新后,我现在有了这个:
GetWidget (getWidgetRequest)
GetWidgets (getWidgetRequest)
GetWidgetGroups (getWidgetRequest)
GetWidget1 (getWidgetRequest1)
GetWidgets1 (getWidgetRequest1)
GetWidgetGroups1 (getWidgetRequest1)
So now I have to use the GetWidget1 method to use the "updated" service method. 所以现在我必须使用GetWidget1方法来使用“更新的”服务方法。 My questions are: 我的问题是:
I found 4 files within the service reference ending in .datasource. 我在.datasource结尾的服务参考中找到4个文件。 They all have the new typename (GetWidget1.datasource, GetWidgetGroups1.datasource, etc.). 它们都具有新的类型名(GetWidget1.datasource,GetWidgetGroups1.datasource等)。 Below is a sample of the contents of the file: 以下是文件内容的样本:
<GenericObjectDataSource DisplayName="GetWidget1" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>GetWidget1, Service References.WidgetService.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>
We're using Visual Studio 2010 version 10.0.40219.1 SP1Rel 我们正在使用Visual Studio 2010版本10.0.40219.1 SP1Rel
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.