La excepción:WCF - Codificación binaria a través de HTTP cliente y el servicio tirar la unión excepción desajuste
aplicación Tipo de Contenido/jabón + msbin1 no fue apoyada por el servicio http://localhost:1500/MyService.svc. Los enlaces de cliente y servicio pueden ser no coincidentes.
La configuración del cliente:
<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>
La configuración del servidor:
<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>
¿El servicio está alojado dentro de IIS u otra aplicación de alojamiento? –
Lo he estado alojando en Visual Studio por ahora. El servidor web incorporado (nunca recuerdo su nombre). Lo implementaré en IIS cuando termine. – mbursill
Tuve este mismo problema si el servidor [endpoint ** Contract **] (http://msdn.microsoft.com/en-us/library/system.servicemodel.description.serviceendpoint.contract.aspx) no coincide con el contrato real utilizado por el punto final. – SliverNinja