Hi I have a service-proxy with one method:
void SendRequest(MyMessage msg);
The MyMessage is defined as follows:
[MessageContract(IsWrapped=false)]
public class MyMessage{
[MessageBodyMember(Order=0)]
public XmlElement Body;
public MyMessage(XmlElement Body){
this.Body = Body;
}
}
Now, the problem is that when I send the request, the Body is wrapped in a tag like so:
<s:Body>
<Body>
<MyMessage>
<SomeData>Hello world</SomeData>
</MyMessage>
</Body>
</s:Body>
when what I really want is:
<s:Body>
<MyMessage>
<SomeData>Hello world</SomeData>
</MyMessage>
</s:Body>
Can someone please help? I'm starting to become desperate! :/
EDIT: The reason I want to send XmlElement is that the service will accept a various amount of XML-formats, and will do the xsd-validation and transformation on the server-side. This is only supposed to be sort of a wrapper.
There is also no way I can have the endpoint-server simply accept the "wrong" xml-structure, as I'm not in control of that.