Soap request

M

Mr. M

How to invoke a web service, using the soap request protocol, without
creating a Web reference to the service.???


Thanks.
Mauri.-
 
M

Mickey Williams

Creating a web reference is just a convenient way to ask Visual Studio to
create a proxy for you. In large apps we typically create our own proxies
that are distributed as assemblies. You can use a VS-generated proxy as a
starting point - just create a web reference, then look at the generated
proxy code.

// namespaces elided

namespace MyApp.WebServiceProxy
{
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="MyServiceSoap",
Namespace="http://www.servergeek.com/demos/2004")]
public class MyService: SoapHttpClientProtocol
{
public MyService(string url)
{
this.Url = url;
}

[SoapDocumentMethod("http://www.servergeek.com/demos/2004",

RequestNamespace="http://www.servergeek.com/demos/2004",

ResponseNamespace="http://www.servergeek.com/demos/2004",
Use=SoapBindingUse.Literal,

ParameterStyle=SoapParameterStyle.Wrapped)]
public string Hello(string message)
{
object[] results = this.Invoke("Hello", new object[] {message});
return ((string)(results[0]));
}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top