Hey All,
I am using a C# client that generates xml that then gets sent via a web service to a java web service server side. In this case, we are creating the messages ourselves, based on the contract defined by the java wsdl.
I am looking for some advice on what the best approach is for this. Currently, on the client, my classes for Objects just wrap xml. This means If I had a person object, and I did:
Person p = new Person(PersonEl ement);
p.firstName;
p.firstName = "NewName";
the getter would be actually running an xpath to the attribute, and the same with the set. When I want the xml output, it's simple because I just get the Element that the object is wrapping.
However, this seems like it would be expensive compared to using an object, and then just serializing/deserializing when needed.
I have played around a little with XMLSerializer, and I have looked at DataContractSer ializer. Problem with DCS is that you cannot specify what is an attribute, and what is an element.
Is there anything in .NET similar to JAXB in java, or is XMLSerializer the closest thing?
Thanks so much!
I am using a C# client that generates xml that then gets sent via a web service to a java web service server side. In this case, we are creating the messages ourselves, based on the contract defined by the java wsdl.
I am looking for some advice on what the best approach is for this. Currently, on the client, my classes for Objects just wrap xml. This means If I had a person object, and I did:
Person p = new Person(PersonEl ement);
p.firstName;
p.firstName = "NewName";
the getter would be actually running an xpath to the attribute, and the same with the set. When I want the xml output, it's simple because I just get the Element that the object is wrapping.
However, this seems like it would be expensive compared to using an object, and then just serializing/deserializing when needed.
I have played around a little with XMLSerializer, and I have looked at DataContractSer ializer. Problem with DCS is that you cannot specify what is an attribute, and what is an element.
Is there anything in .NET similar to JAXB in java, or is XMLSerializer the closest thing?
Thanks so much!
Comment