locked
Custom wsHttpBinding to disable WS-Addressing RRS feed

  • Question

  • I have a custom binding that inherits the WSHttpBinding class.  Is it possible to disable WS-Addressing, so that WCF does not require the consumer to add WS-Addressing headers?

    Monday, July 26, 2010 8:31 PM

Answers

  • It is possible but not with WSHttpBinding. With custom binding just set messageVerion on the textMessageEncoding element to "Soap12".
    http://webservices20.blogspot.com/
    WCF Security, Performance And Testing Blog
    • Marked as answer by Serene Trees Tuesday, July 27, 2010 1:49 PM
    Monday, July 26, 2010 10:33 PM

All replies

  • Hi

    Have you tried changing the EnvelopeVersion and MessageVersion properties of the Text Message Encoding element?

    Cheers,

    Francois


    Please, mark the answer as helpful if it is. Thanks.
    Monday, July 26, 2010 9:08 PM
  • You can do it by changing the MessageVersion property of a MessageEncodingBindingElement:

    WSHttpBinding otherBinding = new WSHttpBinding();
    CustomBinding currentBinding = new CustomBinding(otherBinding);
    MessageEncodingBindingElement encodingElement = currentBinding.Elements.Find<MessageEncodingBindingElement>();
    encodingElement.MessageVersion = MessageVersion.Soap11;
    
    HTH


    Fabio Cozzolino
    Microsoft MVP Connected System Developer
    Blogs: http://dotnetside.org/blogs/fabio http://weblogs.asp.net/fabio
    Professional WCF 4 - http://bit.ly/avD3xE
    Monday, July 26, 2010 9:29 PM
  • I can do that, but one more question.  Is there any way to disable WS-Addressing while still using SOAP 1.2?  Worded in a different way, is it possible to use SOAP 1.2 without WS-Addressing, or does the SOAP 1.2 standard require WS-Addressing?
    Monday, July 26, 2010 10:20 PM
  • It is possible but not with WSHttpBinding. With custom binding just set messageVerion on the textMessageEncoding element to "Soap12".
    http://webservices20.blogspot.com/
    WCF Security, Performance And Testing Blog
    • Marked as answer by Serene Trees Tuesday, July 27, 2010 1:49 PM
    Monday, July 26, 2010 10:33 PM
  • Did you get your question answered? @Serene Trees
    Wednesday, August 15, 2018 10:36 AM