views:

134

answers:

3

I have an environment in which I cannot add another HTTP container (whether ServiceHost, IIS, etc.) but I still need to process SOAP requests (represented as strings) with a WCF web service. I was hoping to write a simple wrapper method (C#) such as:

string processSoapMessage(string req);

In that method, I would manually create a System.ServiceModel.Channels.Message instance with an XML reader that operates on the input string. I was hoping to avoid writing manual dispatching code by creating a ChannelDispatcher that would process the resulting Message instance, but it seems that ChannelDispatchers are tied to a particular ServiceHost, something I cannot have in my environment if it requires an open port. Is there some dispatching code I can call to accomplish this without creating a hosting container?

A: 

So you cannot create a simple console app that will create and open a ServiceHost to host your service class?

Marc

marc_s
Anything that requires an open port is prohibited, but it just occurred to me that I might be able to use named pipes endpoints. I am going to try that.
Dan
You can't even use port 80?
John Saunders
+1  A: 

Assuming everything is happening on the same machine, then using a Named Pipe binding is probably your best bet.

tbreffni
A: 

Whatever you do, don't use the System.String type to hold XML. Pass an XmlReader or XmlDocument or something. Always use XML APIs to manipulate XML.

John Saunders
Downvoter: huh? You think manipulating XML as strings is a good plan?
John Saunders