Greetings all,
I’m developing a WCF webservice in PB.net 12.5.1. I can execute the webservice using the WCF Test Client, but when my customer tries to call it, we get an http 415 error. The incoming call is a straight XML call, no soap, hence the WCF service. I’ve tried several iterations of changes in the web.config file to no avail.
The actual error that we see using WireShark is:
29 4.423768 192.168.0.204 11.111.11.111 HTTP HTTP/1.1 415 Cannot process the message because the content type 'application/xml;charset=utf-8' was not the expected type 'text/xml; charset=utf-8'. (text/html)
According to some documentation on msdn, this means the following: “in my hosting code it turned out that I was using ServiceHost instead of WebServiceHost to host my WCF WebHttp service”. I have no idea what this means, or where to look for, or correct this setting. Here’s my web.config for the service. Any help would be much appreciated.
Thanks!!
Paul
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding name="webHttpBindingConfig">
<security mode="None">
</security>
</binding>
</webHttpBinding>
</bindings>
<services>
<service name="Sybase.PowerBuilder.WCFNVO.directconnect" behaviorConfiguration="ServiceNameBehavior">
<endpoint address="" binding="webHttpBinding" contract="Sybase.PowerBuilder.WCFNVO.directconnect" bindingNamespace="http://rti.flytetymelimo.com/_WCFService" bindingConfiguration="webHttpBindingConfig" behaviorConfiguration="web" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<!--For debugging purposes set the includeExceptionDetailInFaults attribute to true-->
<behaviors>
<serviceBehaviors>
<behavior name="SimpleServiceBehavior">
<serviceMetadata httpGetEnabled="True" policyVersion="Policy12" />
<serviceDebug includeExceptionDetailInFaults="True" />
</behavior>
<behavior name="ServiceNameBehavior">
<serviceMetadata httpGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="True" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
</configuration>