Developer forum

Forum » Development » Serializing problem

Serializing problem

Magni J. Hansen
Reply

Im building a webservice method returning a Ecommerce.Product object but it fails when running the asmx file.

Im getting this error:

Types 'Dynamicweb.eCommerce.Products.Group.MetaData' and 'Dynamicweb.eCommerce.Products.Product.MetaData' both use the XML type name, 'MetaData', from namespace 'http://microsoft.com/webservices/'. Use XML attributes to specify a unique XML name and/or namespace for the type.


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Magni

The Product object will not serialize well. I suggest you create you own lightweight POCO object with the properties you need and mark it as serialisable and map the values from Product class to it before returning it in the service.

 

You must be logged in to post in the forum