I\'m having a weird issue when consuming a webservice for a product that my company has bought. The product is called Campaign Commander and it\'s made by a company called
I'm not sure if this is any appropriate place to put this, but I was having a hard time getting my Windows Service to connect to a WSDL (using an auto generated web reference).
I was getting the same error as the original poster here. Since I'm not using WCF the app.config would not work for me and caused my service not to start. I did find a post on MSDN where AjayChigurupati states to change
public partial class WsdlService : System.Web.Services.Protocols.SoapHttpClientProtocol {...}
To
public partial class WsdlService : Microsoft.Web.Services3.WebServicesClientProtocol {...}
(Make sure to add the Microsoft.Web.Services3
reference to your project)
Now we have access to the boolean property RequireMtom
and you can surround your calling function like so:
public DownloadResponse downloadDataFile([System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] DownloadRequest Request) {
RequireMtom = true; // ADDED
object[] results = this.Invoke("downloadDataFile", new object[] {
Request});
RequireMtom = false; // ADDED
return ((DownloadResponse)(results[0]));
}
Hopefully this helps someone else with the same problem in the future.