views:

41

answers:

0

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,

<AuthenticationResponseMC xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  <authenticationtoken>67d2564e-fe1a-4126-b34d-21b8d8fd05d8</authenticationtoken> 
  </AuthenticationResponseMC>

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"&gt;e13xxxx-xxxx-xxxx-xxxxxx&lt;/authentication-token&gt;

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