1

I'm developing a project to download the order list from Magento website[V1.5.1] using C#[MVC4.5], Before i start,i builded a dev server copy integral files from www server,and my program running very well on dev server.After that,i changed the webservice reference[http://dev.example.com/index.php/api/v2_soap/?wsdl] to [http://www.example.com/index.php/api/v2_soap/?wsdl],then i got the error message as below:

Server Error in '/' Application.

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). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 566 bytes of the response were: 《?xml version="1.0" encoding="UTF-8"?》 《SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Magento" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"》《SOAP-ENV:Body》《ns1:startSessionResponse》《startSessionReturn xsi:type="xsd:string"》fe4d182c95add56efba2191ed9d4dddb《/startSessionReturn>《/ns1:startSessionResponse>《/SOAP-ENV:Body》《/SOAP-ENV:Envelope》

Here is the Response Header Information:

WWW Server
HTTP/1.1 500 Internal Server Error
Cache-Control: private
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
X-SourceFiles: =?UTF-8?B?RTpcTkVUNC41XFByb2R1Y2VNYW5hZ2VtZW50XFByb2R1Y2VNYW5hZ2VtZW50?=
X-Powered-By: ASP.NET
Date: Mon, 16 Dec 2013 17:09:20 GMT
Content-Length: 17079


Develop Server:
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Encoding: gzip
Vary: Accept-Encoding
Server: Microsoft-IIS/8.0## Heading ##
Set-Cookie: .ASPXAUTH=********; path=/; HttpOnly
X-AspNetMvc-Version: 4.0
X-AspNet-Version: 4.0.30319
X-SourceFiles: =?UTF-8?B?RTpcTkVUNC41XFByb2R1Y2VNYW5hZ2VtZW50XFByb2R1Y2VNYW5hZ2VtZW50?=
X-Powered-By: ASP.NET
Date: Mon, 16 Dec 2013 17:29:36 GMT
Content-Length: 3789

By the way,i tried to change php file Soap.php:
->setHeader('Content-Type','text/xml; charset='.$apiConfigCharset, true);
 but didn't work for me .....

I'm very appreciate if anybody can help,thanks....

vimuth
  • 5,064
  • 33
  • 79
  • 116
Jack
  • 170
  • 2
  • 15
  • Related: http://stackoverflow.com/questions/15481092/the-content-type-application-xmlcharset-utf-8-of-the-response-message-does-not – Jürgen Thelen Dec 15 '13 at 09:40
  • Thanks Jürgen Thelen,i read that before,but i can not find any exactly answer.anyway,thanks for help. – Jack Dec 15 '13 at 18:11

2 Answers2

2

A similar question came up in the Magento stack. I answered it there, see: https://magento.stackexchange.com/questions/42536/problems-calling-magento-soap-v2-service-in-c/43046#43046

Community
  • 1
  • 1
Rian
  • 286
  • 2
  • 11
-1

Use the XML rpc API. It is called ez newsletter. You need to create an API user with access http://jmawebtechnologies.com/support/quickbooks/magento-cloud-cart-connector-installation

Joseph Anderson
  • 4,114
  • 4
  • 45
  • 99
  • Try upgrading to the latest version of Magento. I have clients on 1.702 or higher and it works fine. I know previous versions of Magento have coding errors in their API. – Joseph Anderson Dec 15 '13 at 18:25
  • Thanks Joseph,but the project almost done,so i can not change to "XML RPC API". – Jack Dec 15 '13 at 18:30
  • Actually,recording this result xml,i thought they already returned "SessionID",i just don't know what different between "HTTPS" and "HTTP"... – Jack Dec 15 '13 at 18:38
  • did you ever find a solution for this matter? got exactly the same issue now. – Anselme Aug 10 '15 at 18:43