james

james

  • NA
  • 1.1k
  • 333.8k

Web Service serialization

Jan 12 2004 4:50 PM
Okay, I've hit a wall here. Hopefully someone can shed some light on this for me. Here is the scanario... I have a complex type, lets call it ClassA. ClassA is held in an assembly that I have accessable to both my local application, and to my Web Service. When I create an instance of the remote ClassA (returned by the Web Service), it gets serialized differently that the local instance I have. Teh Web Service version adds the default namespace to each of the elements of the Xml when serialized. This means I can't deserialized it back to an instance of my local ClassA. I've tried overwriting the default by using the [XmlElement(Namespace="...")] attribute, but that did not work. I really need to be able to cast my remote object to my local ClassA type (which are the same, but the framework sees them as seperate because one is called throught a web service). Has anybody worked with this enough to know what I'm talking about? -James

Answers (2)