none
custom encoder with system provided binding RRS feed

  • Question

  •  Hi,

     

    I want to use my custom message encoder with system-provided binding(basicHttpBinding) and not CustomBinding

    Is it possible? If yes, how do I do it?

     

    Thru config, I can use my encoder only with CustomBinding and not with basicHttpBinding.

    Thru code, I could not figure out a way to insert my encoder dynamically. I did try my hands based on http://blogs.msdn.com/markgabarra/archive/2006/05/08/592880.aspx but no luck.

     

    Can someone throw some light on the above ?

     

    -Pallz.

    Monday, August 25, 2008 1:00 PM

Answers

  • Hi,

     

     No, the idea with the "out of the box" bindings is that they support a fixed subset of functionality. You will have to use a custom binding if you want to use your custom message encoder.

     

     Edit: apparently you can initialize a custom binding from a system-provided binding:

     http://msdn.microsoft.com/en-us/library/aa738755.aspx

     

     --larsw

     

    Monday, August 25, 2008 1:10 PM
    Moderator
  • The answer is no. You can only change the encoder of the BasicHttpBinding as it allows you (via the MessageEncoding property, which can be set to either Text or Mtom). No other custom encoders can be added to a BasicHttpBinding, unless you convert it to a custom binding, as Lars suggested.

    Monday, August 25, 2008 6:11 PM

All replies

  • Hi,

     

     No, the idea with the "out of the box" bindings is that they support a fixed subset of functionality. You will have to use a custom binding if you want to use your custom message encoder.

     

     Edit: apparently you can initialize a custom binding from a system-provided binding:

     http://msdn.microsoft.com/en-us/library/aa738755.aspx

     

     --larsw

     

    Monday, August 25, 2008 1:10 PM
    Moderator
  • thanks Larsw ..

    Jus wanted to confirm the same...

     

    Regd initializing the custom binding from system-provided binding, at the end of it all it wont remain basicHttpBinding anymore. The binding will turn to a CustomBindign after that.

     

    Was specifically seeing, if I can just replace the text message encoding element of the basicHtpBinding to my custom encoder - so is something like the following possible (either thru code/config)

     

    <basicHttpBinding>

    <customEncoder>

    <httpTransport>

    </basicHttpBinding>

     

    hopefully the answer is 'NO'

     

    thanks for all the help.

    -Palls

    Monday, August 25, 2008 4:33 PM
  • The answer is no. You can only change the encoder of the BasicHttpBinding as it allows you (via the MessageEncoding property, which can be set to either Text or Mtom). No other custom encoders can be added to a BasicHttpBinding, unless you convert it to a custom binding, as Lars suggested.

    Monday, August 25, 2008 6:11 PM