I own a server application that provides an RPC API based on HTTP/XML. Essentially, it's a poorman's web service. The server accepts HTTP requests itself directly rather than using a webserver stack. Requests and responses use a simple, but proprietary, XML schema. Whenever new methods or parameters are added, I have to make changes in several places to define the methods, and do the custom serialization/deserializat
ion. Furthermore, I have to update interface documentation by hand, hope that I can get it distributed to the various people who are maintaining clients, and then they have to update their custom serialization layers. All of this is a pain.
So I'm trying to convert the RPC layer to use a standardized web service protocol stack that can do modern things like automatically serialize the types to/from the wire protocol, generate client stubs automatically for many languages/platforms, and provide a standardized interface description using something like WSDL. Currently I'm trying to use .NET remoting with some success. I don't want to rely on ASP.NET because my app doesn't typically have access to IIS.
I'm new to this stuff, and I'm just doing simple toy things right now, but so far, I've written a server and client that basically do the job. They get their type information from a shared assembly which has the definitions (metadata) for the server-side objects.
Here's the server code (C#)
public void StartServer()
HttpChannel chan = new HttpChannel(8085);
public class CRemoteSimpleMath : MarshalByRefObject, ISimpleMath
public int Add(int x, int y)
And the client code (managed C++):
HttpChannel^ chan = gcnew HttpChannel();
Type^ proxytype = CRemoteSimpleMath::typeid;
CRemoteSimpleMath^ obj =
But I'm concerned about non-.NET clients. I have users that will need to code on other platforms to a common spec. I understand that I need to keep the types simple and not use any .NET framework types in the API, but that's no problem for me. I just don't know how to return a WSDL file to a client. What's the right technique for this?
I saw somewhere that I could just append "?WSDL" to the url for the service, which sounds good, but doesn't seem to work. I get an exception (below) if I request it in my browser. I think 've verified that the server object is alive at the time - it's a Singleton object, and if I call it with my client, the call works fine and the debugger shows the constructor isn't being called again. Anyone know what's wrong?
ion: Object reference not set to an instance of an object.
Type serviceTypes, SdlType sdlType, Stream outputStream)
l(SdlType sdlType, IServerResponseChannelSink
Stack sinkStack, ITransportHeaders requestHeaders, ITransportHeaders responseHeaders, Stream& outputStream)
inkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)