views:

117

answers:

1

Hi. I am looking for a proper framework to implement the (web)service tier in .NET. I am a little bit familiar with WCF and wondering, if it can be customized the way I want it.

1)There is an industry standard for messages to be sent/recieved by the system, which defines the operations, types used, etc. It is XML based. It requires all requests/responses to be wrapped in an envelope, e.g.:

<xxx:Message>
  <xxx:Header>
    //some header data
  </xxx:Header>
  <xxx:Body>
    <xxx:Command>
      //request data
    </xxx:Command>
    <xxx:Command>
      //request data
    </xxx:Command>
  <xxx:Body>
</xxx:Message> 

The xxx:Command element actually identifies the operation to be performed and parameters, or contains the command execution result.
The WCF wraps everything to SOAP envelope. Can it be customized to send all requests using the envelope in the sample above, instead of SOAP? How should I code my services, so that all outgoing and incoming messages are parsed correctly. Should I look to [MessageContract] or [DataContract] attributes or both?

2)One-way operations. The industry standard states that the services should respond with the "acknowledgment" message, that the request has been received. I was looking at the one-way operations, that implement the similar approach - they notify the client as soon as the message is received by the server. I am wondering, how can I customize the "acknowledgment" message being sent to conform to the industry standard.

If WCF does not allow that, can you forward me to any other possible solution out there - Remoting, maybe some other web-services libraries?

A: 

1) Neither attribute will help you. Those attributes are interpreted by the binding (e.g., WS-HttpBinding) to determine how to actually create your messages. You're going to have to write a custom binding to do this, and possibly a custom serializer depending on how "request data" fields are structured.

2) Again, you're going to need to write a custom binding.

A quick search didn't show any existing implementations of a GSA S2S binding for WCF.

There are existing engines for S2S (for example S2SConnect). The licensing costs may or may not be worth the time savings from having to develop your own implementation.

Lars Kemmann
Thanks, for the explanation.From the further studies it was revealed, that implementation should use soap as the transport, so the s2s messages are wrapped in the soap envelope. I won't have to do anything with WCF stack - basicHttpBinding will do just fine. Implementing s2s protocol then means creating all the stack to process the handle the delivered XML messages.
Warvick