2014-09-01 7 views
2

내 개발 환경 (Win 7)에서 WCF를 호출하는 Silverlight 응용 프로그램이 있습니다. Fiddler에서 반환 된 콘텐츠 유형을 검사 할 때 아래와 같이 표시됩니다. 콘텐츠 유형 'application/soap + msbin1'이 예상 유형이 아니기 때문에 메시지를 처리 ​​할 수 ​​없습니다. 'text/xml

HTTP/1.1 200 OK 
Cache-Control: private 
Content-Length: 18849 
Content-Type: text/xml; charset=utf-8 
Server: Microsoft-IIS/7.5 
X-AspNet-Version: 4.0.30319 
X-Powered-By: ASP.NET 
Date: Mon, 01 Sep 2014 14:59:01 GMT 

그러나, 곧 내가 내 QA 서버에 애플리케이션을 배포로 WCF 서비스에 대한 호출이 다음 오류 (다시 피들러에서 따라)

HTTP/1.1 415 실패 (6.0 IIS) 'application/soap + msbin1'콘텐츠 유형이 'text/xml'유형이 아니기 때문에 메시지를 처리 ​​할 수 ​​없습니다. charset = utf-8 '.

왜 텍스트/xml에서 변경되는지 궁금합니다. charset = utf-8 (배포시 응용 프로그램/soap + msbin1)

나는 일치하지 않는 바인딩에 대해 읽었고 모든 것이 클라이언트와 서버간에 일치하는지 확인하려고했지만 컨텐츠 유형 일치를 얻을 수는 없습니다.

다음은 제 구성의 조각입니다. 아래에있는 Web.Config

<system.serviceModel> 
    <bindings> 

     <basicHttpBinding> 
      <binding name="DataSoap" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> 
       <security mode="Transport" /> 
      </binding> 
      <binding name="DataSoap1" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> 
       <security mode="Transport" /> 
      </binding> 
     </basicHttpBinding> 
     </bindings> 
    <services> 
     <service name="MyApp.Web.GetData" behaviorConfiguration="MyApp.Web.GetData" > 
      <endpoint address="" binding="basicHttpBinding" bindingConfiguration="DataSoap" contract="MyApp.Web.GetData" /> 
      <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
      <behavior name="MyApp.Web.GetData"> 
       <serviceMetadata httpsGetEnabled="true" httpGetEnabled="true"/> 
       <serviceDebug includeExceptionDetailInFaults="true"/> 
       <dataContractSerializer maxItemsInObjectGraph="2147483646"/> 
      </behavior> 
      <behavior name=""> 
       <serviceMetadata httpsGetEnabled="true" httpGetEnabled="true" /> 
       <serviceDebug includeExceptionDetailInFaults="true" /> 
      </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> 
</system.serviceModel> 

그리고

은 "= ServiceReferences.ClientConfig

<configuration> 
<system.serviceModel>   
    <bindings>    
     <basicHttpBinding> 
      <binding name="DataSoap" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> 
       <security mode="Transport" /> 
      </binding> 
      <binding name="DataSoap1" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> 
       <security mode="Transport" /> 
      </binding> 
     </basicHttpBinding>   
     <customBinding> 
      <binding name="CustomBinding_GetData"> 
       <binaryMessageEncoding /> 
       <httpsTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" /> 
      </binding> 
     </customBinding> 
    </bindings> 
    <client> 
     <endpoint address="//localhost/MyApp/Webservice/Data.asmx" 
      binding="basicHttpBinding" bindingConfiguration="DataSoap" 
      contract="ServiceReference1.DataSoap" name="DataSoap" /> 

     <endpoint address="//localhost/MyApp/Webservice/GetData.svc" 
      binding="basicHttpBinding" bindingConfiguration="DataSoap1" 
      contract="GetData.GetData" name="CustomBinding_GetData" /> 
    </client> 
</system.serviceModel> 

답변

0

를 나는 내가 보안 모드를 넣어 무슨 짓을했는지 비슷한하고 있어요입니다 아무 " 그리고 지금 나를 위해 작동합니다. 시도해 볼 수 있습니다. 하지만 보안 모드를 사용해야하는 경우 basicHttpBinding 대신 WSHttpBinding 같은 다른 유형의 바인딩을 시도해야한다고 생각합니다.

P.D. 5 개월 응답 지연 ^^