1

In the context of a WCF project, I need to handle in the same way xml and non-xml messages (eg. Standard SOAP, WS-Attachments, etc..). The normal flow of WCF creates a Message object which can handle an Xml message, this is done by the encoder, so if one wants to handle different messages, it's needed to implement different kind of message-handling...

My needs is to create a message derivation class, which represent the concept of "received message" but not "handled" in the form of special data handling, but , about real data-handling, deferred in a secondary step.

so in the catch-all service I will get a Message messageObject as parameter, so the signature of the service will be Message Accept(Message messageObject)

Any idea? thanks in advance

Hoghweed
  • 1,938
  • 1
  • 16
  • 35
  • Please give us more information. I don't really have any idea what you're talking about. How is this related to WCF? – Tad Donaghe Nov 30 '11 at 16:05

1 Answers1

0

There is only single base Message type in WCF. This is a core type which is used by WCF infrastructure. The type is abstract so generally you can create your custom implementation but in such case you will probably have to replace some WCF channels to correctly use your new type.

If you need to transport message in custom format you are probably not looking for replacing Message type but either replacing encoder, serializer or both.

Community
  • 1
  • 1
Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670
  • This could be true, I've just replaced the encoder, but I don't want to create encoders for many types of messages, and another limit I will cross over is the fact that an encoder is for a single message type, I want a ind of multi encoder... – Hoghweed Nov 30 '11 at 18:40
  • WebMessageEncoder is also able to use both XML and JSON representation so check its implementation and follow the same way. – Ladislav Mrnka Nov 30 '11 at 21:30
  • Ok, this could be very usefull for me, but how to apply to a soap message to and, more important, ho to apply to a service contract which handles a Generic Message as parameter?? – Hoghweed Dec 01 '11 at 00:11