4

我正在尝试继续使用 First Data 的 Global Gateway Web Service 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

我尝试了很多地方提到的“在引用的程序集中重用类型”,但这并没有解决它。有没有人遇到过这个错误?你怎么修好它的?

4

1 回答 1

10

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

更新:引用答案以便于找到它:

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

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

于 2011-08-29T16:23:39.050 回答