views:

29

answers:

1

I've found several examples of creating XmlSerializerNamespaces and adding 1 to many namespaces, then serializing based on the object and the list of namespaces.

I can't find any examples of where I have an XML string and I need to deserialize and I want to utilize the namespaces. I've tried reading the string into an XmlTextReader and then setting the Namespaces property to true, but it still didn't work.

A: 

The namespaces are part of the XML document already and when deserializing them should be populated automatically.

The Namespaces property is by default set to true, so no need to set it to true again - see MSDN.

Can you post your code and XML?

Oded
I think this is where I was getting confused. The transaction that comes into my web service starts as <tx:Request ...My schema is defined as:<xsd:complexType name="Request"> <xsd:complexContent> <xsd:extension base="tx:Request_Type">I'm assuming that even though I'm extending the "tx:Request_Type", the top level request needs to be defined as "tx:Request" (in order to match how the transaction is being sent).
jmac