WCF message contracts and namespaces

702 views Asked by At

I have a WCF service which i've defined a message contract for. I've set IsWrapped to false. When I send xml to my service I have to specify the tempuri namespace in the root node of the soap body or the incoming message is null. I was wondering is there any setting I can use so that I don't have to pass in namespace in the xml? I'm using the XmlSerializerFormat by the way. I've tried setting a namespace in the MessageBodyMember but its not working.

1

There are 1 answers

1
Johann Blais On

It looks like you are trying to use POX messages without knowing it. If you want to control the XML structure and force a WCF service to accept it, creating the service to accept POX messages will probably be easier than playing around with all the parameters of a SOAP service to obtain the expected format.

This article explains the POX approach: http://msdn.microsoft.com/en-us/library/aa395208%28VS.90%29.aspx