Webservice with IIS using .NET Remoting

WCF


Sometimes our application is designed 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 the server are not web based but rather running as a service or as a desktop application.
To expose a web service interface we use the .NET remoting framework.
First we register an http channel, define a type that will inherit from the MarshalByRefObject class, and then register this type as a SingleCall type - which says 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, however, 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.
Run it with these parameters: soasuds -url:http://loclahost:port/objectType?wsdl -os:c:\service.wsdl
and wait for a generation of a wsdl file that can be used thereafter in a .NET/PHP/Java applications.
(PHP can call a web service with the Nusoap library).
.NET Remoting is outdated now and it would be better to use WCF instead.  WCF allows better security and can generate the WSDL without any external tools.

Post a Comment

Previous Post Next Post