SoapFault exception: [HTTP] Unsupported Media Type when accessing Java web-service from PHP

前端 未结 2 1401
甜味超标
甜味超标 2021-01-05 04:50

I\'m trying to connect to a Java web-service using the Zend_Soap_Client from the Zend Framework v1.9.0:



        
2条回答
  •  没有蜡笔的小新
    2021-01-05 05:14

    I am not using Zend framework, but had a similar problem with XMLHttpRequest in JavaScript. The solution was to specify the Content-Type in the SOAP request header.

    var sr = '  32';
    http_request = new XMLHttpRequest();
    http_request.open('POST', 'http://www.w3schools.com/webservices/tempconvert.asmx', true);
    http_request.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
    http_request.send(sr);
    

提交回复
热议问题