2011-10-18 2 views
0

나는 wcftester에서 다음을받을를 GET Type.HTTP web.config 반면추가 behaviorConfiguration 원인 (415) 지원되지 않는 미디어는 원격 서버에서 오류를 반환 오류 내가 behaviorConfiguration에 추가 할 때

<system.serviceModel> 
    <services> 
     <service behaviorConfiguration="MaxConfig" name="MyRemoteHostService"> 
     <endpoint address="" binding="basicHttpBinding" 
        bindingConfiguration="BasicHttpBinding_MyRemoteHostService" 
        contract="My.Framework.Web.MyRemoteHostService" /> 

     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
     </service> 
    </services> 
    <serviceHostingEnvironment aspNetCompatibilityEnabled="false" 
     multipleSiteBindingsEnabled="true" /> 



    <bindings> 
     <basicHttpBinding> 
     <binding name="BasicHttpBinding_MyRemoteHostService" 
      maxBufferPoolSize="2147483647" 
      maxReceivedMessageSize="2147483647" 
      maxBufferSize="2147483647"> 
      <readerQuotas 
       maxArrayLength="2147483647" 
       maxBytesPerRead="2147483647" 
       maxDepth="2147483647" 
       maxNameTableCharCount="2147483647" 
       maxStringContentLength="2147483647" /> 
     </binding> 
     </basicHttpBinding> 
    </bindings> 



    <behaviors> 
     <serviceBehaviors> 
     <behavior name="MaxConfig"> 
      <serviceMetadata httpGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="false" /> 
      <dataContractSerializer maxItemsInObjectGraph="2147483647" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 


    </system.serviceModel> 

ServiceReferences.ClientConfig

<system.serviceModel> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="BasicHttpBinding_MyRemoteHostService" maxBufferSize="2147483647" 
      maxReceivedMessageSize="2147483647"> 
      <security mode="None" /> 
     </binding> 
     </basicHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
     <endpoint address="http://localhost:2622/MyRemoteHostService.svc" 
     binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_MyRemoteHostService" 
     contract="MyServiceReference.MyRemoteHostService" name="BasicHttpBinding_MyRemoteHostService" /> 
    </client> 
    </system.serviceModel> 

오류 :

답변

1

415 오류 메시지가 발생하여 하루 이상이 걸리므로 서버의 web.config가 dev와 다른 것으로 밝혀졌습니다. 이는 바인딩이 다르다는 것을 의미합니다. 클라이언트 (SL)와 서버의 wcf 서비스가 415 메시지를 발생시키는 것으로 보입니다 (다소 의미가 있습니다). 위의 바인딩이 올바르게 보이고 재확인 할 가치가 있습니다. behaviorConfiguration을 추가 한 후 서비스 참조를 업데이트하려고 시도 했습니까? 가끔 작동합니다. 불행히도 HTTP 오류 코드는 매우 오해의 소지가 있습니다. ...

+0

우리는 올바른 서비스 이름과 끝점 계약에 네임 스페이스를 추가했습니다. – rob

관련 문제