MessageContract and <s:Body> namespaces RRS feed

  • Question

  • Hi All!

    I'll try to implement MDM service for Windows Phone. 

    In documentation RequestSecurityToken return RequestSecurityTokenResponse with <s:Body> without any namespaces...

    My MessageContract reply:

    <s:Body xmlns:xsi= xmlns:xsd=>
      <RequestSecurityTokenResponseCollection xmlns=>

    How i can remove namespaces from Body tag?

    My RequestSecurityTokenCollection:

    public class RequestSecurityTokenResponseCollection
        [MessageBodyMember(Namespace = "")]
        [XmlElement(ElementName = "RequestSecurityTokenResponse")]
        public List<RequestSecurityTokenResponse> RequestSecurityTokenResponse { get; set; }
        public RequestSecurityTokenResponseCollection()
            this.RequestSecurityTokenResponse = new List<EnrollmentServer.RequestSecurityTokenResponse>();

    May be some custom IDispatchMessageFormatter? But i don't know how to change Body tag..

    Wednesday, September 9, 2015 6:19 AM


  • Hello Alexey.U,

    Yes, you could create a custom IDispatchMessageFormatter.  As the namespace declarations in the body element actually do not change the meaning of the message this normally is not necessary.  

    This tends to be required when the message is being read by an older service or client that does not read the message as a true XML parser.  I have encountered this when talking to older java services.

    Here are some posts to get you started:


    Wednesday, September 9, 2015 9:32 PM