2014-02-10 30 views
0

我一直在研究一個WCF服務,這是在VS 2008中開發並託管在Windows Server 2008,IIS 7.0, 當我在我的本地環境中託管此服務時,它的工作正常但當我在生產站點中託管此服務時,它不起作用。 在該服務中,我使用wsHttpBinding綁定,和我使用的安全模式是消息和clientcredential類型爲「用戶名」有沒有渠道積極傾聽wcf

<security mode= "Message"> 
    <message clientCredentialType="UserName" /> 
</security> 

在行爲的配置我使用

<behavior name="name"> 
     <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" httpsGetUrl="https://serviceurl/basic"/>     
    <serviceDebug includeExceptionDetailInFaults="true" /> 
    <serviceCredentials> 
    <serviceCertificate findValue="CN=WMSvc-AMAZONA-PJ1K606" /> 
    <userNameAuthentication userNamePasswordValidationMode="MembershipProvider" embershipProviderName="WCFSqlProvider" /> 
    </serviceCredentials> 
    </behavior> 

但是當我消費我的客戶端應用程序的服務它給我的錯誤

有沒有渠道積極監聽「/ /服務託管/ servicename/$元數據的機器的名稱」這往往是原因由不正確的地址URI編輯。確保 消息發送到的地址與服務正在偵聽的地址匹配。

回答

0

看起來像你的問題是與元數據,根據錯誤消息。

<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" httpsGetUrl="//https://serviceurl/basic"/>   

嘗試刪除在httpsGetUrl屬性的開始//,他們可能給你造成麻煩。

下面是配置的幾個例子:http://msdn.microsoft.com/en-us/library/ms731317(v=vs.110).aspx

+0

hey..tewr其打字錯誤。 – Chandra

0
<system.serviceModel> 
    <bindings> 
     <webHttpBinding> 
     <binding name="TransportSecurity"> 
      <security mode="Transport"> 
      <transport clientCredentialType="None"/> 
      </security> 
     </binding> 
     </webHttpBinding> 
    </bindings> 
    <services> 
     <service name="Service" behaviorConfiguration="ServiceBehaviour"> 
     <endpoint address="" binding="webHttpBinding" behaviorConfiguration="webMyAcc" bindingConfiguration="TransportSecurity" contract="IService"/> 
     <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="ServiceBehaviour"> 
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="false" /> 
     </behavior> 
     </serviceBehaviors> 
     <endpointBehaviors> 
     <behavior name="webMyAcc"> 
      <webHttp /> 
     </behavior> 
     </endpointBehaviors> 
    </behaviors> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 
    <client /> 
    </system.serviceModel>