public string GetWelcomeMessage(string value)
{
return "Welcome to WCF " + value;
}
you may find the details of how to host a service in iis @ Hosting WCF in IIS
Make sure that you use "basicHttpBinding" and make the config file changes as

Now Open your VS 2003 application and add a web reference as shown below. Lets call the service reference as "localhost". Lets say you have hosted your service "http://localhost/HelloWorldService/HelloWorld.svc"

After adding the service it will look like this

Now go to you code where you want to make a call to the code
localhost.Service1 objService = new localhost.Service1();
Response.Write(objService.GetWelcomeMessage("Puru"));
The output of this would be "Welcome to WCF Puru".
Hope this helps....
You can also call the same service in Java client. Know more @ Consuming WCF in Java
No comments:
Post a Comment