开发者

WCF message contracts and namespaces

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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜