From: Scott N. <sni...@sc...> - 2003-06-13 21:05:18
|
I think this patch to serialize_val should do the trick. Replace if(is_object($v) && get_class($v) == 'soapval'){ $tt = $v->type; } else { with if(is_object($v) && get_class($v) == 'soapval'){ $tt_ns = $v->type_ns; $tt = $v->type; } else { Replace } else { $array_typename = $tt; } with } else { // if type is prefixed, create type prefix if ($tt_ns != '' && $tt_ns == $this->namespaces['xsd']){ $array_typename = 'xsd:' . $tt; } elseif ($tt_ns) { $tt_prefix = 'ns' . rand(1000, 9999); $array_typename = "$tt_prefix:$tt"; $atts .= " xmlns:$tt_prefix=\"$tt_ns\""; } else { $array_typename = $tt; } } On 13 Jun 2003 at 12:36, Jason Lines wrote: > Im trying to send an array of complex types with the following code... > > $ai = array( > "Asin" => $ASIN, > "ExchangeId" => "", > "Quantity" => "1"); > $items = array(new soapval("AddItem", "AddItem", $ai, > "http://soap.amazon.com", "http://soap.amazon.com")); > > However when this value renders to HTML the namespace is NOT present in > the arraytype definition... > > > <Items xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="AddItem[1]"> > > <nu2756:AddItem xmlns:nu2756="http://soap.amazon.com" > xmlns:ns2196="http://soap.amazon.com" xsi:type="ns2196:AddItem"><Asin > xsi:type="xsd:string">067232525X</Asin><ExchangeId > xsi:type="xsd:string"></ExchangeId><Quantity > xsi:type="xsd:string">1</Quantity></nu2756:AddItem></Items> > > > I would expect the Items tag to specify the namespace > <Items xsi:type="SOAP-ENC:Array" > SOAP-ENC:arrayType="<typens:>AddItem[1]"> > > , is this a bug or am I improperly using the soapval object, any help is > appreciated. > > thanks > Jason Lines > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: eBay > Great deals on office technology -- on eBay now! Click here: > http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 > _______________________________________________ > Nusoap-general mailing list > Nus...@li... > https://lists.sourceforge.net/lists/listinfo/nusoap-general > Scott Nichol Do not reply directly to this e-mail address, as it is filtered to only receive e-mail from specific mailing lists. |