Hi,

When I have a class that has an object variabel where other types is in. When I send a web-request to the server and gets the variable, it works fine when the data is set to known-types. The problem is when I want to use the data in the object returned. I can not typecast it and gets an error when trying to getType() of the object.

How can I make it it's own type of the content? I know the type because of other variables in the class so I just have to make it of this type but how? I have thought about making a xml-parser of these object to the given class; but do not know if this is possible at all and nessesary at all?

Recommended Answers

All 2 Replies

Can you upload a sample project demonstrating this behavior? And by known type are you referring to types in a KnownType attribute or primitive types in the BCL? Which WCF serializer are you using? etc etc.

Can you upload a sample project demonstrating this behavior? And by known type are you referring to types in a KnownType attribute or primitive types in the BCL? Which WCF serializer are you using? etc etc.

Your surgestion of making a simple sample project showed me that the problem was in the client not the wcf-service. I located the problem in a class and fixed it. Thanks for the reply. I've maked it as an answer.. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.