使用VS2010服务参考时的自定义工具警告

时间:2011-08-29 16:05:06

标签: visual-studio-2010 xsd wsdl service-reference firstdata

我正在尝试继续使用First Data的全局网关Web服务API。第一件奇怪的事情是我需要将wsdl和xsd文件下载到我的本地机器上。然后使用本地计算机的副本作为服务参考。我没有使用过很多网络服务,所以我认为没关系。

添加它们并尝试编译后,我收到以下错误:

Warning 1   Custom tool warning: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter
Error: There was a problem loading the XSD documents provided: a reference to a schema element with name 'AVSResponse' and namespace 'http://secure.linkpt.net/fdggwsapi/schemas_us/fdggwsapi' could not be resolved because the element definition could not be found in the schema for targetNamespace 'http://secure.linkpt.net/fdggwsapi/schemas_us/fdggwsapi'. Please check the XSD documents provided and try again.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://secure.linkpt.net/fdggwsapi/schemas_us/fdggwsapi']/wsdl:portType[@name='FDGGWSApiOrder'] C:\Documents and Settings\user\my documents\visual studio 2010\Projects\sltnProcessCreditCard\ProcessCreditCard\Service References\ServiceReference\Reference.svcmap    1   1   ProcessCreditCard

Warning 2   Custom tool warning: Cannot import wsdl:binding
Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://secure.linkpt.net/fdggwsapi/schemas_us/fdggwsapi']/wsdl:portType[@name='FDGGWSApiOrder']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://secure.linkpt.net/fdggwsapi/schemas_us/fdggwsapi']/wsdl:binding[@name='FDGGWSApiOrderBinding']   C:\Documents and Settings\user\my documents\visual studio 2010\Projects\sltnProcessCreditCard\ProcessCreditCard\Service References\ServiceReference\Reference.svcmap    1   1   ProcessCreditCard

Warning 3   Custom tool warning: Cannot import wsdl:port
Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://secure.linkpt.net/fdggwsapi/schemas_us/fdggwsapi']/wsdl:binding[@name='FDGGWSApiOrderBinding']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://secure.linkpt.net/fdggwsapi/schemas_us/fdggwsapi']/wsdl:service[@name='FDGGWSApiOrderService']/wsdl:port[@name='FDGGWSApiOrderPort'] C:\Documents and Settings\user\my documents\visual studio 2010\Projects\sltnProcessCreditCard\ProcessCreditCard\Service References\ServiceReference\Reference.svcmap    1   1   ProcessCreditCard

我尝试了许多地方提到的“Reuse types in referenced assemblies”并且没有修复它。有没有人遇到过这个错误?你是怎么解决的?

1 个答案:

答案 0 :(得分:9)

我发现this answer似乎至少让我继续工作。与此同时,我对其他想法持开放态度。

更新:引用答案以便于查找:

  

尝试将其添加为.NET 2.0 Web Reference。

     

转到添加服务参考,然后单击“高级”按钮。然后,您可以选择将其添加为.NET 2.0 Web引用。我这样做了,并让它工作。我无法通过标准的“添加服务参考”