realn
realn

Reputation: 1742

How to use WCF Message for writing Multiple Objects

I have this requirement, I have two classes Person and Department and i want to send object of these two classes in the System.ServiceModel.Channels.Message? How can i accomplish this. I there any best way alternative to that.

Thanks in advance.

Upvotes: 0

Views: 97

Answers (1)

Chandermani
Chandermani

Reputation: 42659

Message class has a static method called CreateMessage which has an overload to take any object that can be serialized.
Create a new datacontract\class with instances of Person and Department object. Pass the wrapper object to CreateMessage to serialize

Upvotes: 1

Related Questions