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

Bug #7064 namespaces broken in some cases by fix for bug 4639
Submitted: 2006-03-08 22:28 UTC
From: danielc Assigned:
Status: No Feedback Package: SOAP (version 0.9.3)
PHP Version: 5.0.5 OS: linux
Roadmaps: (Not assigned)    
Subscription  


 [2006-03-08 22:28 UTC] danielc (Daniel Convissor)
Description: ------------ While the change made to version 1.76 of Client.php (cvs diff -u -r1.75 -r1.76 Client.php) in response to bug 4639 fixed namespacing in some cases, it broke it in others. We have two service providers we communicate with via SOAP. The first is a .NET based, with a WSDL file and no authentication. That now works in 0.9.3, thanks. The second service is some unix based SOAP server with no WSDL file and an authentication and options in the SOAP header. This is now broken. In the expected/actual blocks below is the XML we send to the provider. Notice how the username and password elements aren't prefixed with "ns4:" and the style and output elements aren't prefixed with "ns5:". I hacked up a patch that allows us to communicate with both of our service providers once again. I doubt this is the "solution," but perhaps it will lead you to it. Anyway, here it is: Index: Base.php =================================================================== RCS file: /repository/pear/SOAP/Base.php,v retrieving revision 1.56 diff -u -u -r1.56 Base.php --- Base.php 16 Jan 2006 23:32:06 -0000 1.56 +++ Base.php 8 Mar 2006 22:26:02 -0000 @@ -986,6 +986,8 @@ $options = array()) { $smsg = $header_xml = $ns_string = ''; + $prior_section5 = $this->_section5; + $this->_section5 = false; if ($headers) { $c = count($headers); @@ -1026,6 +1028,7 @@ ">\r\n". "$header_xml$body</SOAP-ENV:Envelope>\r\n"; + $this->_section5 = $prior_section5; return $xml; } Expected result: ---------------- <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 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/" xmlns:ns4="http://www.complianceease.com/soap/authentication/" xmlns:ns5="http://www.complianceease.com/soap/report/" xmlns:ns6="http://www.complianceease.com/soap/ComplianceAuditService/" > <SOAP-ENV:Header> <ns4:authentication SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next" SOAP-ENV:mustUnderstand="0"> <ns4:username>foo@example.com</ns4:username> <ns4:password>bar</ns4:password></ns4:authentication> <ns5:report SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next" SOAP-ENV:mustUnderstand="0"> <ns5:style>full</ns5:style> <ns5:output>xml</ns5:output></ns5:report> </SOAP-ENV:Header> <SOAP-ENV:Body> <ns6:AuditLoanData> <ns6:loanData href="cid:226451669ee7e6d9b922ab86fb1b9701"/></ns6:AuditLoanData> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Actual result: -------------- <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 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/" xmlns:ns4="http://www.complianceease.com/soap/authentication/" xmlns:ns5="http://www.complianceease.com/soap/report/" xmlns:ns6="http://www.complianceease.com/soap/ComplianceAuditService/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Header> <ns4:authentication SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next" SOAP-ENV:mustUnderstand="0"> <username xsi:type="xsd:string">foo@example.com</username> <password xsi:type="xsd:string">bar</password></ns4:authentication> <ns5:report SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next" SOAP-ENV:mustUnderstand="0"> <style xsi:type="xsd:string">full</style> <output xsi:type="xsd:string">xml</output></ns5:report> </SOAP-ENV:Header> <SOAP-ENV:Body> <ns6:AuditLoanData> <ns6:loanData href="cid:3dd0ef6aea8c06ec309e092921abd1a0" xsi:nil="true"/></ns6:AuditLoanData> </SOAP-ENV:Body> </SOAP-ENV:Envelope>

Comments

 [2007-01-21 17:13 UTC] yunosh (Jan Schneider)
This should be possible with calling $client->setOpt('use', 'encoded');
 [2007-02-20 21:04 UTC] danielc
Using $client->setOpt('use', 'encoded') in 0.9.4 doesn't change anything. I also tried upgrading to 0.10.1. That made things even worse. The "username", "password", "style" and "output" elements are replaced by elements named "item". Using $client->setOpt('use', 'encoded') produces the same output. OUTPUT FROM 0.10.1 ------------------ <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 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/" xmlns:ns4="http://www.complianceease.com/soap/authentication/" xmlns:ns5="http://www.complianceease.com/soap/report/" xmlns:ns6="http://www.complianceease.com/soap/ComplianceAuditService/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Header> <ns4:authentication xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[2]" SOAP-ENC:offset="[0]" SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next" SOAP-ENV:mustUnderstand="0"> <item xsi:type="xsd:string">foo</item> <item xsi:type="xsd:string">bar</item></ns4:authentication> <ns5:report xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[2]" SOAP-ENC:offset="[0]" SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next" SOAP-ENV:mustUnderstand="0"> <item xsi:type="xsd:string">full</item> <item xsi:type="xsd:string">xml</item></ns5:report> </SOAP-ENV:Header> <SOAP-ENV:Body> <ns6:AuditLoanData> <ns6:loanData href="cid:f0c26d64db6747fc690f2dece708ae84" xsi:nil="true"/></ns6:AuditLoanData> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
 [2007-02-20 21:06 UTC] danielc
To be clear, in my last comment, when I said "Using $client->setOpt('use', 'encoded') produces the same output." I meant that 0.10.1 produces the same output with and without that option.
 [2007-09-28 19:57 UTC] danielc (Daniel Convissor)
Bug 10567 may be a duplicate or a better fix for this.
 [2008-07-15 13:36 UTC] yunosh (Jan Schneider)
If this still happens with the code from CVS, can you provide a unit test, or at least a wsdl file or link to reproduce this? The request is perfectly fine, unless it doesn't match a wsdl resource.
 [2008-08-04 08:40 UTC] yunosh (Jan Schneider)
No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you.