PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework Webservice serialization problem

Reply

Webservice serialization problem

 
Thread Tools Rate Thread
Old 08-03-2006, 04:18 PM   #1
Jeffry van de Vuurst
Guest
 
Posts: n/a
Default Webservice serialization problem


Hi,

I'm having a problem with calling a webservice on the compact framework. The
compact framework appears to have a problem with serializing inherited
types. Let me give you an example (for those familiar with it, I'm
connecting to the MS CRM webservices).

There's a base class ColumnSetBase with two subclasses, AllColumns and
ColumnSet. There a webservice method that takes as a parameter a class with
a property of type ColumnSetBase.

When I fill that property with an object of type ColumnSet and I look at
what the webservice receives, the ColumnSet is empty.

Another example. Base class QueryBase, two subclasses QueryExpression and
QueryByAttribute. When I put an object of type QueryExpression in a property
of type QueryBase and pass that to the webservice, it's empty. However, I
wrote a test method in the webservice that takes a parameter of type
QueryExpression. When I pass in an object of type QueryExpression it works.
So it seems to go wrong with the casting from sub to base class.

I generated the webreferences in a separate device project. And when I
reference that project in a .NET windows application, everything works fine.

I have some workarounds, like xmlserializing the object to a string and then
passing it to an adapted version of the webservice method. If I do that, the
properties are serialized fine. But I'd rather find out why this doesn't
work.

Any ideas? I couldn't find anything on the web related to this problem.

Thanks,

--
Jeffry van de Vuurst
CWR Mobility
www.cwrmobility.com
--


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off