Silverlight 사용 WCF 서비스가있는 웹 사이트가 있습니다. 이 서비스는 정상적으로 작동하며 문제없이 브라우저에서 WSDL 페이지를 탐색 할 수 있습니다.프로그래밍 방식으로 WCF 클라이언트 만들기
이제 클라이언트를 DLL에 만들려고합니다. 프로그래밍 방식으로 전체 클라이언트를 만들 필요가 있습니다. 이유는 무엇이든 (의도적으로?) 자체 구성 파일에서 ServiceModel 섹션을 읽지 않는 DLL에서 호출되기 때문입니다. 그래서 여기
내 코드입니다 :
Dim endp As EndpointAddress = New EndpointAddress("http://www.mydomain.com/licensing/lic.svc")
Dim bind As WSHttpBinding = New WSHttpBinding()
Dim svc = New lnt.licClient(bind, endp)
Dim rsp = svc.CheckIt(key)
하지만 난이 svc.CheckIt 메서드를 호출 할 때, 나는 다음과 같은 오류 얻을 :
Content Type application/soap+xml; charset=utf-8 was not supported by service http://www.mydomain.com/licensing/lic.svc.
The client and service bindings may be mismatched.
{"The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'application/soap+msbin1'.."}
내가 제대로이 있도록 내 클라이언트를 작성하는 방법을 제대로 "일치"되어 있습니까 ??
미리 감사드립니다.
Sivlerlight는 WSHttpBinding을 지원하지 않습니다. http://msdn.microsoft.com/en-us/library/cc896571(VS.95).aspx –