Serializing complex types in return message

R

rseroter

Hello,

I'm working with a scenario where I have a base abstract data entity
(ContactDTO) and a number of inherited concrete classes (ex,
StandardContactDTO). My web service method returns the base entity
type, which means that in theory, I could return any of the concrete
instance types.

My WSDL shows all the appropriate complex types defined. However, when
I call my service, the message I get back is:

The specified type was not recognized: name='StandardContactDTO',
namespace='http://tempuri.org/', at <GetContactsResult
xmlns='http://tempuri.org/'>

Now, I've tried appending XmlInclude attributes at both the base class,
and web service method level. I know that in theory, this should force
the compiler to attach the appropriate types to the service assembly.
However, that doesn't appear to be working.

So, is there some sort of tweak in order to get complex inherited types
to be returned from web services? I'd like to avoid the need to have
individual service methods that explicitly return each type of concrete
class, as opposed to a single method that can return each type.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top