WCF - Binäre Codierung über HTTP zu werfen client-und service-binding-mismatch Ausnahme
Ausnahme:
Content-Type application/soap+msbin1
war nicht unterstützt durch service
http://localhost:1500/MyService.svc.
Die client-und service-Bindungen sein können
nicht übereinstimmende.
Client-Konfiguration:
<system.serviceModel>
<bindings>
<customBinding>
<binding name="NetHttpBinding" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00">
<binaryMessageEncoding />
<httpTransport allowCookies="false" bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard" maxBufferSize="65536"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
transferMode="Buffered" useDefaultWebProxy="true" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://localhost:1500/MyService.svc"
binding="customBinding" bindingConfiguration="NetHttpBinding"
contract="APP.BLL.IMyServiceContract" name="MyServiceEndpoint" />
</client>
</system.serviceModel>
Server-Konfiguration:
<system.serviceModel>
<bindings>
<customBinding>
<binding name="NetHttpBinding" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00">
<binaryMessageEncoding />
<httpTransport allowCookies="false" bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard" maxBufferSize="65536"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
transferMode="Buffered" useDefaultWebProxy="true" />
</binding>
</customBinding>
</bindings>
<services>
<service name="MyAppService">
<endpoint address="" binding="customBinding" bindingConfiguration="NetHttpBinding"
contract="APP.BLL.IMyServiceContract">
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
- Ist der service innerhalb von IIS gehostet wird, oder anderer hosting-Anwendung?
- Ich habe einen hosting es in Visual Studio für jetzt. Der eingebaute webserver (ich kann nie mehr an den Namen erinnern). Ich werde der Bereitstellung auf IIS, wenn Sie fertig sind.
- Ich hatte das gleiche Problem, wenn der server Endpunkt Vertrag entspricht nicht dem eigentlichen Auftrag des Endpunkts.
Du musst angemeldet sein, um einen Kommentar abzugeben.
Können Sie nicht verwenden binaryMessageEncoding und HTTP ohne customBindings. Sie können textMessageEncoding oder mtomMessageEncoding aus der box.
Finden Sie in diesem blog-post für Verweis auf die Verwendung von customBindings mit HTTP-transport.
application/soap+msbin1
content-Typ mit einemcustomBinding
Konfiguration. Jeff Barnes posting richtig sind.