I've been given a service which I need to consume. This service is only happy when added to the project as a 'web reference' and NOT a 'service reference'. When I add the reference, the app.config is modified as shown here...
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="TestApp.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>
<TestApp.My.MySettings>
<setting name="TestApp_DemoService_Rfx" serializeAs="String">
<value>https://www.mydemosourcesite.com:443/common/services/Rfx/</value>
</setting>
</TestApp.My.MySettings>
</applicationSettings>
I can consume the service fine, except that the response it's returning uses MTOM. My question is - how can I configure this service to use MTOM for the message encoding. If I were doing this with a service reference, I'd do this...
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="RfxSOAP" messageEncoding="Mtom">
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://www.mydemosourcesite.com:443/common/services/Rfx/" binding="basicHttpBinding" bindingConfiguration="RfxSOAP" contract="DemoService.Rfx" name="RfxSOAP" />
</client>
</system.serviceModel>
Sadly though, I'm not using a service reference and no idea how to get this configured for a web reference! This is in VB and .NET 4.
All help appreciated!