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

  • SEARCH
  • Home
  • 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 7021549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:27:55+00:00 2026-05-27T23:27:55+00:00

So, I used a wsdl provided for me to generate all my base client

  • 0

So, I used a wsdl provided for me to generate all my base client code for WCF. When I attempt to communicate with the service, I get an error. The error says that the content type of the binding does not match that of the response message.

After firing up Fiddler, I looked at the raw data going out and coming back. It turns out, the Magento server that I’m attempting to talk to is returning two Content-Type values. Again, using Fiddler, I forced a response to my client with only one Content-Type, and it worked just fine.

Now, I’d like nothing more than to have the Magento server respond properly, as this would be the “correct” solution to this problem. However, that is out of my control (different company that doesn’t want to fix it). So, I need to intercept the headers when WCF gets them and have it ignore the duplicate. After searching the interwebs for a while, I’m still trying to figure out the “best” way of doing this. Or “any” way to do this, for that matter.

Anyone able to point me to the right thing to override and what I need to do to remove a superfluous Content-Type?

  • 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-27T23:27:56+00:00Added an answer on May 27, 2026 at 11:27 pm

    You should be able to implement an IClientMessageInspector to manipulate and remove the superfluous Content-Type in the response received from the Magento Server in the AfterReceiveReply method.

    EDIT:

    So you can access the HTTP headers in the received response via HttpResponseMessageProperty that is available in

    void IClientMessageInspector.AfterReceiveReply(ref Message reply, Object correlationState)
    {
        var prop = 
            reply.Properties[HttpResponseMessageProperty.Name] as HttpResponseMessageProperty;
    
        if (prop != null)
        {
            // get the content type headers
            var contentType = prop.Headers["Content-Type"];
        }
    }
    

    however, Content-Type appears to be a restricted header. Perhaps a little reflection may solve the issue, but hopefully this gives you some ideas.

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

Sidebar

Related Questions

I'm creating a web-service client. I used a WSDL file to generate the client
I am following WSDL-first (provided by our client) approach for developing WCF service but
In a WCF service used by a Silverlight 4 app, I get this error:
I used axis1 tool to generate my client from a WSDL. My problem is
I have to implement a webservice client to a given WSDL file. I used
We have received a WSDL from our client that we use to communicate with
According to http://www.w3schools.com/WSDL/wsdl_documents.asp binding means communication protocol used by a web-service. I know of
I started with a WSDL and used wsimport to generate the Java artificats. Then
I am creating a client using jax-ws generated code. The WSDLs used specify a
I have a WSDL generated by WCF and now this WSDL should be used

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.