배포 된 wcf 서비스 (.net 4.0). 시도어떻게 REST 모드에서 WCF 서비스를 사용합니까?
<endpoint address=""
binding="webHttpBinding"
bindingNamespace="https://mydomain/myservice/services"
behaviorConfiguration="WebBehavior"
contract="MyService" />
<endpointBehaviors>
<behavior name="WebBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
웹 응용 프로그램에 서비스를 사용 web.config
의 모습, :
는 일부 인터넷 검색 후, 우리는 방법에 대한운영 '방법 항목'서비스를 호출 할 때
<system.serviceModel> <client> <endpoint name="MyServiceEndpointBasicHttp" address="http://myDomain/myService" binding="webHttpBinding" behaviorConfiguration="webBehavior" contract="MyNamespace.IMyService" /> </client> <behaviors> <endpointBehaviors> <behavior name="webBehavior"> <webHttp /> </behavior> </endpointBehaviors> </behaviors> </system.serviceModel>
나는 예외를 받고 있어요 같은 서비스 측 설정 보인다 'IMyService'는 요청 본문 매개 변수가 이되도록 랩퍼없이 일련 번호를 지정합니다. 요소. 최대 하나의 본문 매개 변수 은 래퍼없이 요소로 직렬화 할 수 있습니다. 추가 본체 매개 변수를 제거하거나 WebGetAttribute/WebInvokeAttribute의 BodyStyle 속성을 래핑으로 설정하십시오.
[WebGet(BodyStyle = WebMessageBodyStyle.WrappedRequest, ResponseFormat = WebMessageFormat.Xml)]
을 설정할 수 있지만 한 성공없이 ...
한 가지 흥미로운 점 : 같은 방법 이름도 내가 다른 메소드를 호출하고있어, 예외가 항상있다. 메소드 이름과 필요한 PARAMATERS를 입력하여 브라우저를 테스트하는 동안 ..
서비스는이 스레드에서와 유사한 문제에 직면 해 보인다
서비스 방법 정의에 ** 서비스 계약 **을 표시 할 수 있습니까? –