Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.14.0

Request #16645 "application/soap+xml" Transport Media Type Support
Submitted: 2009-09-25 21:57 UTC
From: mauz Assigned:
Status: Verified Package: SOAP (version 0.12.0)
PHP Version: 5.2.5 OS: Debian
Roadmaps: (Not assigned)    
Subscription  


 [2009-09-25 21:57 UTC] mauz (Hartmut Wilhelms)
Description: ------------ The Oracle-Application-Server-10g/10.1.3.1.0 does not understand the "Content-Type: text/xml ..." and always throws an VersionMismatch Error. This Error disappeared, when I set this to "Content-Type: application/soap+xml ..." as specified in Appendix A of the SOAP Version 1.2 Part 2 Specification. I Propose a new Option for call with the Name 'media_type', which specifies the String after Content-Type and before charset within the HTTP Header. This could be realized by the following lines of code within Transport/HTTP.php (about line 449): if (isset($options['media_type'])) { $this->headers['Content-Type'] = $options['media_type']."; charset=$this->encoding"; } else { $this->headers['Content-Type'] = "text/xml; charset=$this->encoding"; } Test script: --------------- $client =& new SOAP_Client(<url>); $opts = array ( 'trace' => true, 'media_type' => 'application/soap+xml', .... ); $res = $client->call (<method>, <values>, $opts); Expected result: ---------------- POST /path HTTP/1.0 User-Agent: PEAR-SOAP 0.12.0-beta Host: vsrv25.domain.de Content-Type: application/soap+xml; charset=UTF-8 Content-Length: 372 SOAPAction: "http://service.domain.de//method" Connection: close Actual result: -------------- POST /path HTTP/1.0 User-Agent: PEAR-SOAP 0.12.0-beta Host: vsrv25.domain.de Content-Type: text/xml; charset=UTF-8 Content-Length: 372 SOAPAction: "http://service.domain.de//method" Connection: close

Comments

 [2009-09-27 10:23 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Verified
That's a pity. Soap 1.1 is happy with text/xml http://www.w3.org/TR/2000/NOTE-SOAP-20000508/ Soap 1.2 is application/soap+xml http://www.w3.org/TR/2007/REC-soap12-part2-20070427/ Bad oracle, making life difficult!
 [2009-10-05 17:34 UTC] mauz (Hartmut Wilhelms)
It is should be possible also to receive "application/soap+xml" encoded messages. This could be accieved by changing File Transport/HTTP.php als follows: 400c400 < } elseif ($this->result_content_type != 'text/xml') { --- > } elseif (!in_array ($this->result_content_type, array('text/xml', 'application/soap+xml'))) {