2010-12-12 2 views
0

WCF 서비스를 로컬로 만들고 테스트 한 결과 정상적으로 작동합니다. 나는 공유 호스팅 사이트에 게시하고 wsdl을 탐색하고 괜찮을 것 같습니다. 하지만 서비스 WP7 코드에서 전화를 걸면 쓸모없는 오류 메시지가 나타나는 오류가 발생합니다. includeExceptionDetailInFaults 및 WCF 추적을 사용하도록 설정하면 오류를 읽습니다. "System.ServiceModel.ProtocolException : Content type application/soap + xml; charset = utf-8이 text/xml; charset = utf-8을 기대하는 서비스로 전송되었습니다. 클라이언트와 서비스 바인딩이 일치하지 않을 수 있습니다."WP7의 WCF 클라이언트와 서비스 바인딩이 일치하지 않을 수 있습니다.

여기 "=

<behaviors> 
    <serviceBehaviors> 
    <behavior name="SL_SeeYaThere_WCF.Web.SeeYaThereWCFBehavior"> 
    <serviceMetadata httpGetEnabled="true" /> 
    <serviceDebug httpHelpPageEnabled ="true" includeExceptionDetailInFaults="true" /> 
    </behavior> 
    <!—- other services… --> 
    </serviceBehaviors> 
</behaviors> 

<bindings> 
    <basicHttpBinding> 
    <!—- there is not a binding for this service should there be? --> 
    <!—- other services… --> 
    </basicHttpBinding> 
</bindings> 

< 서비스>
< 서비스 behaviorConfiguration ="SL_SeeYaThere_WCF.Web.SeeYaThereWCFBehavior "이름

...의 Web.config의 일부입니다 SL_SeeYaThere_WCF.Web.SeeYaThereWCF ">
< endpoi mexHttpBinding "계약 ="IMetadataExchange "/>
</서비스>
"= 바인딩 "NT 어드레스 =" "바인딩 ="은 BasicHttpBinding "계약 ="SL_SeeYaThere_WCF.Web.ISeeYaThereWCF "/>
< 종점 어드레스 ="MEX <! - 기타 서비스 ... ->
</services>

^^ 형식에 대해 자세히 알아보세요. 편집기는 마크 업을 올바르게 표시하지 않습니다.

이것은 WFC의 첫 경험이며 즐겁지 않았습니다. 내가 도대체 ​​뭘 잘못하고있는 겁니까?

도움 주셔서 감사합니다.

답변

0

이 문제가 발생했습니다. WP7 앱에는 클라이언트 바인딩이있는 ServicesReferences.clientConfig 파일이 있습니다. WCF 서비스에는 Localhost 용 끝점과 공유 호스팅 된 주소 용 끝점 두 개가있었습니다. 로컬 호스트에서 공유 호스트 사이트로 서비스 참조를 구성 할 때 발생 했어야합니다.

로컬 호스트 추가자를 공유 호스트 주소로 변경했는데 작동합니다.

관련 문제