2010-09-17 35 views
3
Warning 1 Custom tool warning: Cannot import wsdl:binding 
Detail: The given key was not present in the dictionary. 
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://wrapper.dao.ccarwebservice.ids.com']/wsdl:binding[@name='CCaRWebServiceHttpBinding'] C:\Users\me\Documents\Visual Studio 2008 \Projects\CcarsWcfTest\CcarsWcfTest\Service References\ServiceReference1\Reference.svcmap 1 1 CcarsWcfTest 

我該如何解決此問題?爲wcf添加服務參考的問題

我已經嘗試從命令提示符運行服務實用程序並向我的項目添加服務引用。我也進入了「添加服務引用」對話框中的高級設置,並取消了「在所有引用的程序集中重用類型」。

編輯

這裏是WSDL,我認爲它引用的一部分。這

<wsdl:binding name="CCaRWebServiceHttpBinding" type="ns:CCaRWebServicePortType"> 
    <http:binding verb="POST"/> 
    <wsdl:operation name="fnGetccarprogramsummaryarray"> 
     <http:operation location="CCaRWebService/fnGetccarprogramsummaryarray"/> 
     <wsdl:input> 
      <mime:content type="text/xml" part="fnGetccarprogramsummaryarray"/> 
     </wsdl:input> 
     <wsdl:output> 
      <mime:content type="text/xml" part="fnGetccarprogramsummaryarray"/> 
     </wsdl:output> 
    </wsdl:operation> 
    <wsdl:operation name="fnGetccarprogramsummary"> 
     <http:operation location="CCaRWebService/fnGetccarprogramsummary"/> 
     <wsdl:input> 
      <mime:content type="text/xml" part="fnGetccarprogramsummary"/> 
     </wsdl:input> 
     <wsdl:output> 
      <mime:content type="text/xml" part="fnGetccarprogramsummary"/> 
     </wsdl:output> 
    </wsdl:operation> 
</wsdl:binding> 



public partial class fnGetccarprogramsummaryarrayRequest 
{ 

    public fnGetccarprogramsummaryarrayRequest() 
    { 
    } 
} 

別人都是這樣......

public partial class fnGetccarprogramsummaryRequest 
{ 

    [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://wrapper.com", Order=0)] 
    [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] 
    public string programAcronym; 

    public fnGetccarprogramsummaryRequest() 
    { 
    } 

    public fnGetccarprogramsummaryRequest(string programAcronym) 
    { 
     this.programAcronym = programAcronym; 
    } 
} 
+2

第一步是縮小問題範圍。然後發佈仍然導致問題的WSDL的最小子集。 – 2010-09-17 15:51:32

+1

但是它指的是什麼? – Avien 2010-09-17 17:47:47

回答

0

搜索後..我遇到的唯一解決方案是忽略此錯誤。

「這是SvcUtil工具的內部實現細節。

該錯誤可能是因爲WSDL包含一個POST綁定和utlity僅適用於SOAP綁定。但是,如果有另一個SOAP在它的工作原理WSDL綁定。 「

1

哪兒來的WSDL從哪裏來?它是如何產生的?

它可能是缺少輸入和返回類型的定義。

  • fnGetccarprogramsummaryarray
  • fnGetccarprogramsummary。

這可能是它試圖尋找類型數組中的定義而沒有找到它。

編輯

我認爲,我發現你有一個POST綁定和工具僅支持SOAP綁定

http://social.msdn.microsoft.com/Forums/en/wcf/thread/859a2c87-02db-469d-ab65-c558ff091e61

是不存在的,關鍵是那麼SOAP綁定。

+0

wsdl來自另一公司網站。我們正在使用一個常規的asmx服務,一切正常,所以我不知道返回類型丟失。 – Avien 2010-09-27 14:27:04

+0

您可以在記事本中打開wsdl文件,並檢查fnGet類型的定義...還有哪些技術是在其他網站上實現的服務? – 2010-09-27 17:22:51

+0

他們正在使用soap ..消息級安全和客戶端證書。不知道這是否正是你的意思。好吧,我要更新我的問題以顯示fnGetccarprogramsummaryarrayRequest。所有其他fnGets都有返回類型或參數。 – Avien 2010-09-28 15:39:24