1. Simple webserive created:
Using system;
Using system. Web;
Using system. collections;
Using system. Web. Services;
Using system. Web. Services. Protocols;
/** // <Summary>
/// Summary description for wstest
/// </Summary>
[WebService (namespace = "http://tempuri.org/")]
[Webservicebinding (conformsto = wsiprofiles. basicprofile1_1)]
Public class wstest: system. Web. Services. WebService ...{
Public wstest ()...{
// Uncomment the following line if using designed components
// Initializecomponent ();
}
[Webmethod]
Public String helloworld ()...{
Return "Hello world !!! ";
}
}
2. Call on the page:
Using system;
Using system. Data;
Using system. configuration;
Using system. Web;
Using system. Web. Security;
Using system. Web. UI;
Using system. Web. UI. webcontrols;
Using system. Web. UI. webcontrols. webparts;
Using system. Web. UI. htmlcontrols;
Public partial class _ default: system. Web. UI. Page
...{
Protected void page_load (Object sender, eventargs E)
...{
Wstest T = new wstest ();
Response. Write (T. helloworld ());
}
}
Run through
Display
Hello world !!!