Showing results for 
Search instead for 
Did you mean: 

Wsi ContentType setHeaders and C# Service Reference

Wsi ContentType setHeaders and C# Service Reference

 Hello guys.


I'm using a C# Service Reference to integrate with Magento, and I was getting an error like this:



Which translates to:


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


So upon further investigation I found someone with the same problem here:


Essentially the guy who answered, instructed to change this line (in app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php):


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

To this:


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


This is the ContentType header before the change:



And this is after:




I googled a bit and found that the header takes only a single media type and subtype.


 Is this right? Can I safely change the setHeaders() call in Soap.php?