2008-11-19 65 views
0

我的WCF從來沒有使用wsbinding,但是當我切換到基本時,它工作正常。WCF綁定,basicHttpBinding與wsHttpBnding

我需要做什麼才能使wsbinding工作?

更新

當我說沒有工作,我指的是客戶端從來沒有能夠消費的服務端點。

我需要在某處添加用戶名/密碼嗎?

+0

這不是用戶名/密碼的問題(假設你正確配置了它)。你能給我們提供關於客戶端的更多信息嗎,它是一個Silverlight應用程序嗎?當使用wsBinding時,Visual Studio是否可以生成服務引用? – AgileJon 2009-05-31 11:40:54

回答

1

首先,你使用的是Visual Studio 2005或2008?接下來,如果您使用VS2005,您是否安裝了2006年發佈的WCF/WF的.NET 3.0 CTP工具?我問這些問題是因爲我想知道如何在客戶端設置代理類。你有沒有點擊右鍵,並「添加服務參考」或「添加Web參考」

此外,您的WCF配置文件看起來類似於下面?這顯示了一個雙重設置,包括Basic和WsHttp綁定。

<system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="wsHttp"> 
      <security mode="None"> 
      <transport clientCredentialType="None" /> 
      <message clientCredentialType="None" negotiateServiceCredential="false" establishSecurityContext="false" /> 
      </security> 
     </binding> 
     </wsHttpBinding> 
     <basicHttpBinding> 
     <binding name="basicHttp"/> 
     </basicHttpBinding> 
    </bindings> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="NorthwindBehavior"> 
      <serviceMetadata httpGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="true" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <services> 
     <service behaviorConfiguration="NorthwindBehavior" name="SampleApplicationWCF.Library.SupplierService"> 
     <endpoint binding="wsHttpBinding" bindingConfiguration="wsHttp" name="wsHttpSupplierService" contract="SampleApplicationWCF.Library.ISupplierService" /> 
     </service> 
    </services> 
    </system.serviceModel>