I’ve just published a WCF service that uses wsHttpBinding to Azure. When in development environment, I’ve added the service reference just fine, but after the deployment to Azure, the Service Reference didn’t generate the proxy classes. I had to switch to a Web Reference to get the code generation working. Why?
Here is my config file:
<?xml version="1.0"?>
<configuration>
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<services>
<service name="MyService.DataSync">
<host>
<baseAddresses>
<add baseAddress="http://localhost:57059"/>
<add baseAddress="http://xxxxxxxxxxx.cloudapp.net"/>
</baseAddresses>
</host>
<endpoint address=""
binding="wsHttpBinding" bindingConfiguration="" name="SvcEndpoint"
contract="MyLibrary.IDataSync" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="true"/>
</system.webServer>
<connectionStrings>
<add name="db" connectionString="...."/>
</connectionStrings>
</configuration>
Thanks.
Add this behaviourConfiguration to your endpoint