| |
Sign In
The request failed with HTTP status 415: Unsupported media type
After a lot of digging around and comparing my code with the MTOM sample bundled with WSE3, i found out it was because i was missing a setting called "soapServerProtocolFactory" in my web.config, shown below. I didn't think i needed to have a Protocol Factory (whatever that is!), but apparently I do. It works fine now that i added that section.
<?xml version="1.0" encoding="utf-8"?><configuration> <configSections> <section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> </configSections> <appSettings> <add key="UploadPath" value="Upload" /> </appSettings> <system.web> <webServices> <soapServerProtocolFactory type="Microsoft.Web.Services3.WseProtocolFactory, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> <soapExtensionImporterTypes> <add type="Microsoft.Web.Services3.Description.WseExtensionImporter, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> </soapExtensionImporterTypes> </webServices> <compilation> <assemblies> <add assembly="Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> </assemblies> </compilation> </system.web> <microsoft.web.services3> <messaging> <mtom serverMode="optional" /> </messaging> </microsoft.web.services3></configuration>
<?xml version="1.0" encoding="utf-8"?><configuration> <configSections> <section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <section name="UploadWinClient.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </sectionGroup> </configSections> <microsoft.web.services3> <messaging> <mtom clientMode="On" /> </messaging> </microsoft.web.services3> <applicationSettings> <UploadWinClient.Properties.Settings> <setting name="UploadWinClient_MTOM_WebService_MTOM" serializeAs="String"> <value>http://localhost:1423/UploadWebClient/MTOM.asmx</value> </setting> </UploadWinClient.Properties.Settings> </applicationSettings></configuration>
myClassLibrary.WebService = this.WebService;
myClassLibrary.WebService.CookieContainer = this.WebService.CookieContainer;
Remember Me