views:

670

answers:

1

Hi all,

I'm creating a basic web service in asp.net/c# using simple ASMX services. When I create a method that returns a class, this class definition is discoverable by clients of the service.

I'm wondering if there is a way to expose a class to the service that isn't used directly in any of the service methods. I need my service clients to know about a particular class even though it doesn't appear as a return value or parameter type in any of the methods.

I realise this is a strange requirement, but it comes about because we're serialising the object and compressing the serialised file. We send the object as a byte[] ultimately. This is causing an issue when it comes to deserialising it on the other end as the client doesn't know about the class.

Is there a way to decorate a class so that it's discoverable through service discovery?

Thanks in advance,

Martin.

+3  A: 

Use the XmlInclude attribute on an exposed class to include another one.

Gerrie Schenck
Exactly what I was looking for. Thanks very much for quick reply.
Martin