WCF MessageContract Help - MessageBodyMember with hyphenated name
- by Hcabnettek
Hi All,
I need a bit of WCF help. This project uses message contracts. The transport seems to work ok. I have this code for a response type.
namespace tpoke.Contracts
{
[MessageContract(IsWrapped = true)]
public class AuthenticationResponseMC
{
[MessageBodyMember(Name = "authentication-token")]
public Guid AuthenticationToken;
}
}
Now when I run the operation that returns this, I try to deserialize using the XmlSerializer. The is not what I'm needing. I need it to be
<authentication-token xmlns="http://tpoke.wcf.com">e13xxxx-xxxx-xxxx-xxxxxx</authentication-token>
How can I make this work correctly? Do I need to add the namespace to MessageBodyMember? Why is the hyphen being stripped out? Any tips or advice is certainly appreciated.
Thanks,
~ck in San Diego