2011-08-29 41 views
4

我想繼續使用First Data的全球網關Web服務API。第一件奇怪的事情是,我需要將wsdl和xsd文件下載到本地機器上。然後使用本地機器的副本作爲服務參考。我沒有使用過很多網絡服務,所以我覺得這很好。使用VS2010服務時的自定義工具警告參考

加入他們,並試圖對其進行編譯後,我得到了以下錯誤:

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」,而不能解決問題。有沒有人遇到過這個錯誤?你怎麼修好它的?

回答

9

我發現this answer似乎至少讓我繼續工作。與此同時,我對其他想法持開放態度。

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

嘗試將其添加爲.NET 2.0 Web引用。

轉到添加服務參考,然後單擊「高級」按鈕。然後您可以選擇將其添加爲.NET 2.0 Web Reference。我做到了這一點,並將其付諸實施。我無法通過標準的「添加服務參考」