Web Service Without IIS

Sometimes our application will be required to expose an interface that is widely used and standardised like the famous web services, post/get gateways e.t.c
Now we will assume that the main application or server are not web based but rather running as a service or on desktop.
To expose a web service interface we will use the .NET remoting framework.
First we will register an http channel, define a type that will inherit the MarshalByRefObject class, and then register this type as a SingleCall type - which means that every object of this type is created for the purpose of serving a call from the client and then dying peacefully.

We won't be able to see the description of the method by surfing with the browser but we still have to provide a wsdl file for it. So we will resort to a special tool included in the Microsoft .NET SDK: soapsuds.
Running it like this: soasuds -url:http://loclahost:port/objectType?wsdl -os:c:\service.wsdl
will generate the wsdl file that can be used thereafter in a .NET/PHP/Java applications.
PHP can call a web service with the Nusoap library.

Post a Comment

Previous Post Next Post