Here is a quick answer that can probably expand.
When you use the WSDL templating application (WSDL.exe) to generate service wrappers, it creates a class like SoapHttpClientProtocol. You can also do this manually:
public class MyService : SoapHttpClientProtocol { public MyService(string url) { this.Url = url; // plus set credentials, etc. } [SoapDocumentMethod("{service url}", RequestNamespace="{namespace}", ResponseNamespace="{namespace}", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public int MyMethod(string arg1) { object[] results = this.Invoke("MyMethod", new object[] { arg1 }); return ((int)(results[0])); } }
I have not tested this code, but I think it should work autonomously without having to run the WSDL tool.
The code I provided is the caller’s code, which connects to the web service through a remote call (even if for some reason you don’t actually want it to be deleted.) The Invoke method takes care of packing it like a Soap call. The @Dave Ward code is correct if you want to bypass the web service call through HTTP - as long as you can actually reference the class. Perhaps the internal type is not "MyService" - you will need to check the control code to know for sure.
Steve eisner
source share