Home » Web Services » SOAP » Bug #1927
SOAP-ENC:arrayType="Struct[] without namespace in SOAP_Fault SOAP-0.8RC3
Details
| Submitted | 2004-07-20 15:38 UTC |
|---|---|
| From | tilman dot baumann at pyramid dot de |
| Assigned | yunosh |
| Status | Closed |
| Package | SOAP |
| PHP Version | 4.3.6 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2004-07-20 15:38 UTC] tilman dot baumann at pyramid dot de
Description:
------------
The way how SOAP_Fault builds the <detail/> element seens to be not correct.
It uses a xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="Struct[7]" element.
Im not 100% sure if that is really no right.
But i agree with the message of my client (SOAP::Lite perl) that Struct[] has no namespace.
I think here should be a namespace set.
I tryed to give a plain string as $detail at the construction of SOAP_Fault. But that confuses php verry hard. ;)
<SOAP-ENV:Fault>
<faultcode xsi:type="xsd:string">SOAP-ENV:Client</faultcode>
<faultstring xsi:type="xsd:string">MESSAGE</faultstring>
<faultactor xsi:type="xsd:anyURI"></faultactor>
<detail xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="Struct[7]" SOAP-ENC:offset="[0]">
PS: the tatatype xsi:string for faultcode is hacked for my buggy perl client which can not handle QName elements. Don't get confused by that.
Reproduce code:
---------------
return new SOAP_Fault('MESSAGE', 'Client', '', 'bla');
Expected result:
----------------
Maybe
<detail xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:Struct[7]" SOAP-ENC:offset="[0]">
?
Don't know.
Actual result:
--------------
<SOAP-ENV:Fault>
<faultcode xsi:type="xsd:string">SOAP-ENV:Client</faultcode>
<faultstring xsi:type="xsd:string">MESSAGE</faultstring>
<faultactor xsi:type="xsd:anyURI"></faultactor>
<detail xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="Struct[7]" SOAP-ENC:offset="[0]">
...
[2004-10-21 15:30 UTC] robert at accettura dot com
This is a blocker for a project I'm working on.
Any known workaround until PEAR::SOAP is updated would be appreciated.
[2004-10-25 03:08 UTC] mir at datanom dot net
Hi,
I think I have solved the bug:-) Try this patch:
--- /tmp/SOAP-0.8RC3/Base.php 2004-01-17 15:22:58.000000000 +0100
+++ /usr/share/php/SOAP/Base.php 2004-10-25 05:00:08.000000000 +0200
@@ -478,15 +478,16 @@
$xmlout_offset = " SOAP-ENC:offset=\"[0]\"";
if (!$arrayType) {
$numtypes = count($array_types);
- if ($numtypes == 1) $arrayType = array_type;
// using anyType is more interoperable
if ($array_type == 'Struct') {
$array_type = '';
} else if ($array_type == 'Array') {
$arrayType = 'anyType';
$array_type_prefix = 'xsd';
- } else
+ } else {
+ if ($numtypes == 1) $arrayType = $array_type;
if (!$arrayType) $arrayType = $array_type;
+ }
}
}
if (!$arrayType || $numtypes > 1) {
Regards,
Michael