Where's the SOAP message...???

Hello,

I've started learning about web services,i mean i'm a real newbie,so my question can be very silly..sorry about that.

I have created a very simple web service and added a simple method:

[WebMethod]

public string combine(string name, string surname)

{

StringBuilder sb_name = new StringBuilder(name);

sb_name[0] = (sb_name[0].ToString ().ToUpper().ToCharArray ())[0];

return sb_name + " " + surname.ToUpper ();

}

and use this method from my client application like this:

private void button1_Click(object sender, EventArgs e)

{

localhost.Service myservice = new NewApp.localhost.Service();

MessageBox.Show (myservice.combine("myname","mysurname"));

}

it works,no problem.. But in some ebooks that i read they talk about SOAP messages,created and receivng them...but where is the SOAP message in my application..if missing why does it work

Thanks very much...




Answer this question

Where's the SOAP message...???

  • Thomas089

    The tools and libraries are totally hiding the SOAP details from you. Your use of the [WebMethod] attribute indicates that your 'combine' method is a SOAP method.

    You have not mentioned the WebService attribute you are no doubt also using. The way you code the WebService attribute names your Web Service, and the SOAP Action tag of the actual call will be 'combine' in this case, but in the namespace you identified in your Web Service attribute (there's a default of "http://tempuri.org") IIRC.

    Hope this helps get you started,

    Howard



  • Where's the SOAP message...???