You are here

Content Type Error Consuming Magento 1.5 Webservices from .Net

wwwJust encountered a problem consuming Magento webservices from .Net:

The content type text/xml; charset=utf-8,text/xml; charset=UTF-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8).

The fix is pretty easy. You need to adjust this file /app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php

Change line 

                    ->setHeader('Content-Type','text/xml; charset='.$apiConfigCharset)


                ->setHeader('Content-Type','text/xml; charset='.$apiConfigCharset, true)

You need to do it twice in that file. Also, if you are using the WS I Compliant version, you need to change /app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php file

Social Buttons: 



Thank you klotin,

This is exactly what I'm getting now when trying to use Magento API from .Net.

Can you please tell me if it's possible to prevent this error on .Net side?
(My client is afraid to change magento files :-()



Thanks mate, this worked for me. I did have an error after updating this because I was missing the php soap extension, once i also installed that it all worked a treat


Add new comment

Get Updates

RSS Twitter

Subscribe by Email:

Recent Comments

Who's online

There are currently 0 users online.