Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6385109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:51:29+00:00 2026-05-25T02:51:29+00:00

I’m currently using a custom message encoder that does GZIP compression. I would like

  • 0

I’m currently using a custom message encoder that does GZIP compression. I would like to migrate that over to step-by-step a solution where I use IIS7’s builtin (HTTP’s “Accept-Encoding: gzip”) compression:

  1. update server to support both legacy and HTTP gzip compression
  2. gradually update all clients to use HTTP gzip compression
  3. potentially remove legacy support

To keep changes in configuration of the infrastructure minimal, I’d like to

  • use the same URL for both legacy and HTTP style compression
  • on the server side be able to distinguish legacy and new style by looking at the Accept-Encoding (or any other custom header to be added, if necessary) – legacy clients do not send ‘Accept-Encoding’, but new clients would (have to, anyway)

This is a snippet of the configuration of one of the services I intend to migrate:

<service name="SomeService" behaviorConfiguration="Common">
  <endpoint address="" binding="customBinding" contract="ISomeService" bindingConfiguration="GZipBinding">
    <identity>
      <dns value="localhost"/>

In theory, I’d see 2 ways to get this done:

  1. Add another endpoint (with same physical address) to the configuration, the new endpoint would use a different binding
  2. Make the distinction inside my custom message encoder

The solution – if it exists – to either of those 2 ways has eluded me so far.

1: I don’t think you can make IIS choose the endpoint based on an http header, IIS will use the soap header (I assume) to make the decision, with the client using ClientViaBehavior: http://msdn.microsoft.com/en-us/library/aa395210.aspx

2: When in MessageEncoder.WriteMessage, I don’t think I have access to the request HTTP headers, but if I had, it would be easy to decide whether or not to gzip.

Any ideas how to solve 1. or 2., or is there a better way to get this done, using a shared URL, and not using ClientViaBehavior? (If not, I guess ClientViaBehavior would be my fallback, that at least seems to be doable)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:51:30+00:00Added an answer on May 25, 2026 at 2:51 am

    Although in the end I solved the problem completely differently, using a custom SOAP header and modifying the GzipMessageEncoder to look at that header to decide whether to compress, I found the answer, but it might be a bit cumbersome to implement.

    Anyway, what lead me to a possible solution was understanding the difference between logical addresses and physical addresses, as explained at http://msdn.microsoft.com/en-us/library/aa395210.aspx . So when you change the address attribute (btw. you don’t need to use the ‘listenUri’ parameter explained in the aforementioned link), it in your code you will have to set the ‘via’ parameter of the Endpoint object to the physical address, whereas the logical address of the Endpoint objects needs to match what you specified in the ‘address’ attribute of the endpoint tag.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm making a simple page using Google Maps API 3. My first. One marker
I want use html5's new tag to play a wav file (currently only supported
I am currently running into a problem where an element is coming back from
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.