Hello All,
I having some issues deploying a wcf service using WSDualHttpBinding into Azure.
When I try to run my server and client locally with administrator rights everything run smoothly.
I can deploy the server side on Azure App Service using publish in VisualStudio, I can access my service using : https://xxx.azurewebsites.net/service.svc
So everything looks good from the server side.
But when I try to access my service using Azure App Service, it raise the following exception :
“The content type text/html; charset=UTF-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were….”
Using Fiddler, I look at the Xml response, which is the following :
My config files are :
Server Side Web.config :
<?xml version="1.0"?>
<configuration>
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
<system.web>
<compilation debug="true" targetFramework="4.7.2" />
<customErrors mode="Off"/>
</system.web>
<system.serviceModel>
<serviceHostingEnvironment minFreeMemoryPercentageToActivateService="0" multipleSiteBindingsEnabled="true" />
<protocolMapping>
<add scheme="http" binding="wsDualHttpBinding" />
</protocolMapping>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="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="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
Client Side App Config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_ISampleContract" clientBaseAddress="http://xxx.azurewebsites.net/" />
</wsDualHttpBinding>
</bindings>
<client>
<endpoint address="http://xxx.azurewebsites.net/Service.svc" binding="wsDualHttpBinding"
bindingConfiguration="WSDualHttpBinding_ISampleContract" contract="ServiceReference1.ISampleContract"
name="WSDualHttpBinding_ISampleContract">
<identity>
<userPrincipalName value="PC001\Aldrin1" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
I’m really confuse where I am missing something, I’m new to WCF and Azure so any help would be really appreciated.
Best,