PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Web Services » SOAP » Bug #2656

soap headers get clobbered in $wsdl->[bindings]...

Details

Submitted2004-11-01 08:30 UTC
Frombyrne at majordojo dot com
StatusNo Feedback
PackageSOAP
PHP Version4.3.9
OSFedora Core Development Release
Roadmaps(Not assigned)

Comments

[2004-11-01 08:30 UTC] byrne at majordojo dot com

Description:
------------
When a WSDL file such as Salesforce.com's file declares a SOAP header element like so:

<operation name="create">
<soap:operation soapAction=""/>
<input>
<soap:header use="literal" message="tns:Header" part="SessionHeader"/>

<soap:header use="literal" message="tns:Header" part="CallOptions"/>

<soap:header use="literal" message="tns:Header" part="SaveOptions"/>
<soap:header use="literal" message="tns:Header" part="AssignmentRuleHeader"/>
<soap:body parts="parameters" use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="InvalidSObjectFault">
<soap:fault name="InvalidSObjectFault" use="literal"/>
</fault>
<fault name="UnexpectedErrorFault">
<soap:fault name="UnexpectedErrorFault" use="literal"/>
</fault>
</operation>

When this happens the logic in SOAP/WSDL.php for setting the input/body element clobbers the previous headers array. Here is a patch that fixes this problem (apply to SOAP-0.8RC3):

=== CUT HERE ===
1194,1195c1194,1195
< $this->wsdl->bindings[$this->currentBinding]
< ['operations'][$this->currentOperation][$this->opStatus] = $attrs;
---
> $newarray = array_merge($this->wsdl->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus],$attrs);
> $this->wsdl->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = $newarray;
=== CUT HERE ===

[2005-09-14 13:22 UTC] pear at public dot alixta dot org

Is this a bug? Any chance it could be confirmed? I am working with pear::soap an am having a few difficulties - would be nice to what is/isn't working as expected.

Cheers
Alistair