Note that there are some explanatory texts on larger screens.

plurals
  1. POAccessing the ServiceModel layer directly
    primarykey
    data
    text
    <p>I'm new to WCF, so apologies if I'm missing the boat completely.</p> <p>It seems like WCF provides plenty of functionality for using the "Channel" layer by itself. For example, to create a server, you can create a channel listener from a binding and call WaitForRequest, Reply, etc. These methods all deal with <strong>Message</strong> objects, so it is up to you to do something with the message.</p> <p>My question has to do with what happens once we've already got a message. Suppose I have an object that implements a service, described by a <strong>ServiceContract</strong>, and a <strong>Message</strong> object which I know represents a call to a particular operation. What I'd really like to do is something like:</p> <pre><code>Message requestMessage = GetMessageSomehow(); OperationDescription oc = GetContractForMessage(); Message replyMessage = Invoke(myService, oc, requestMessage); </code></pre> <p>At the very least, if I could somehow access the <strong>IOperationInvoker</strong> and <strong>IDispatchMessageFormatter</strong> objects that get created for a type, it would be pretty simple to chain them together to get the functionality I'm looking for.</p> <p>In my particular case, I need to implement some simple Soap 1.1 and 1.2 services (with no WS-Addressing). I already have HttpListenerRequest/Response objects, and can route based off of either the SOAPAction or ContentType header.</p> <p>I think having this functionality would also be pretty useful for unit testing. For example, I need to implement to existing clients. It would be nice to have unit tests where I could test that the Attributes on the service class are correct (i.e. that the message that I know I will be getting gets properly translated into a call on my service interface).</p> <p>Any suggestions?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload