當試圖爲此wsdl file(來自ASMX Web服務)生成代理代碼時,WsdlImporter(和svcutil)報告錯誤。我認爲WCF完全向後兼容ASMX網絡服務?請幫助WsdlImporter從ASMX Web服務中導入wsdl時出錯
下面是SvcUtil工具的輸出(我得到使用WsdlImporter同樣的錯誤)導入此WSDL時
Microsoft (R) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.648] Copyright (c) Microsoft Corporation. All rights reserved. Warning: The optional WSDL extension element 'header' from namespace 'http://sch emas.xmlsoap.org/wsdl/soap/' was not handled. XPath: //wsdl:definitions[@targetNamespace='http://mycompany.com/Enterprise/WebS ervice/Finance/']/wsdl:binding[@name='FinanceServiceSoap']/wsdl:operation[@name= 'ProcessNonRefPayment']/wsdl:fault[@name='fault'] Warning: The optional WSDL extension element 'header' from namespace 'http://sch emas.xmlsoap.org/wsdl/soap/' was not handled. XPath: //wsdl:definitions[@targetNamespace='http://mycompany.com/Enterprise/WebS ervice/Finance/']/wsdl:binding[@name='FinanceServiceSoap']/wsdl:operation[@name= 'ProcessRefPayment']/wsdl:fault[@name='fault'] Warning: The optional WSDL extension element 'header' from namespace 'http://sch emas.xmlsoap.org/wsdl/soap/' was not handled. XPath: //wsdl:definitions[@targetNamespace='http://mycompany.com/Enterprise/WebS ervice/Finance/']/wsdl:binding[@name='FinanceServiceSoap']/wsdl:operation[@name= 'SearchPayments']/wsdl:fault[@name='fault'] Warning: The optional WSDL extension element 'header' from namespace 'http://sch emas.xmlsoap.org/wsdl/soap/' was not handled. XPath: //wsdl:definitions[@targetNamespace='http://mycompany.com/Enterprise/WebS ervice/Finance/']/wsdl:binding[@name='FinanceServiceSoap']/wsdl:operation[@name= 'GetPayments']/wsdl:fault[@name='fault'] **Error: Cannot import wsdl:binding** Detail: The given key was not present in the dictionary. XPath to Error Source: //wsdl:definitions[@targetNamespace='http://mycompany.com /Enterprise/WebService/Finance/']/wsdl:binding[@name='FinanceServiceSoap12'] **Error: Cannot import wsdl:port** Detail: There was an error importing a wsdl:binding that the wsdl:port is depend ent on. XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://mycompany.com /Enterprise/WebService/Finance/']/wsdl:binding[@name='FinanceServiceSoap12'] XPath to Error Source: //wsdl:definitions[@targetNamespace='http://mycompany.com /Enterprise/WebService/Finance/']/wsdl:service[@name='FinanceService']/wsdl:port [@name='FinanceServiceSoap12']
嗨達林謝謝你的迴應。不幸的是,我無法訪問代碼。 – user20155 2009-05-27 09:23:08