2012-01-20 66 views
0

我有一個單向的WCF服務,其主要目的是讓網頁內容作爲一個字符串,並進行一些操作。但是我似乎無法打電話給運營合同。它只是不會被調用。如果不是WebPage內容,我會發送短文本(「Hello World」),一切都按預期工作。我在web.config中將maxReceiveMessageSize設置爲max,但我仍然無法傳遞WebPage內容。下面是客戶端的web.config無法調用單向操作的合同在WCF

<system.serviceModel> 
<bindings> 
    <basicHttpBinding> 

    <binding name="basicBinding" allowCookies="false" closeTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" 
      bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" 
      maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text" 
      textEncoding="utf-8" transferMode="Buffered"> 

     <readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="16384" maxBytesPerRead="2147483647" 
        maxNameTableCharCount="16384"/> 

     <security mode="None"> 
     <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> 
     <message clientCredentialType="UserName" algorithmSuite="Default"/> 
     </security> 

    </binding> 

    </basicHttpBinding> 
</bindings> 

<client> 
    <endpoint name="basicHttpEndPoint" 
      address="http://localhost:7777/Serializer.svc" 
      binding="basicHttpBinding" 
      contract="Shared.ISerializer" 
      bindingConfiguration="basicBinding" /> 

</client> 

這裏是我服務的web.config

<system.serviceModel> 
<services> 
    <service name="SerializerService"> 
    <endpoint address="" 
       binding="basicHttpBinding" 
       bindingConfiguration="basicBinding" 
       contract="Shared.ISerializer" /> 
    </service> 
</services> 
<bindings> 
    <basicHttpBinding> 
    <binding name="basicBinding" allowCookies="false" closeTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" 
      bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" 
      maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text" 
      textEncoding="utf-8" transferMode="Buffered"> 

     <readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="16384" 
        maxBytesPerRead="2147483647" maxNameTableCharCount="16384"/> 

     <security mode="None"> 
     <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> 
     <message clientCredentialType="UserName" algorithmSuite="Default"/> 
     </security> 

    </binding> 
    </basicHttpBinding> 
</bindings> 
<behaviors> 
    <serviceBehaviors> 
    <behavior> 
     <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 
     <serviceMetadata httpGetEnabled="true"/> 
     <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> 
     <serviceDebug includeExceptionDetailInFaults="false"/> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 

我缺少的東西?提前致謝。

+2

你試過使WCF跟蹤(如本文檔中http://msdn.microsoft.com/en-us/library/ms733025.aspx解釋) ? – JohnC

+0

嗨,約翰,感謝您的快速回復,不,我沒有收到400錯誤請求錯誤。 – Michael

回答

0

看着你的配置我猜想,服務implmentation類型不叫SerializerService但實際上也是一個命名空間,這意味着WCF ISN; T使用您的服務配置在所有並只使用一個默認端點

與命名空間完全限定服務名稱和你的價值觀應該得到回升

+0

謝謝回覆,你是正確的,在服務的web.config我設置服務的名稱錯誤,而不是「SerializerService」它應該一直在格式「namespace.servicename」,這解決了我的問題。 – Michael