Pear SOAP - sending an array of complex types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I am trying to send an array of complex types to a mapping application
using PHP4 and the Pear::SOAP package.

Here is a part of the message I am sending:

<pre>
<routeStops xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="Struct[2]"
SOAP-ENC:offset="[0]">
	<item>
		<point>
			<x xsi:type="xsd:float">-123.335816</x>
			<y xsi:type="xsd:float">48.420692</y>
			<coordinateSystem>
				<projection xsi:type="xsd:string">4326</projection>
			</coordinateSystem>
		</point>
	</item>
	<item>
		<point>
			<x xsi:type="xsd:float">-123.392048</x>
			<y xsi:type="xsd:float">48.483424</y>
			<coordinateSystem>
				<projection xsi:type="xsd:string">4326</projection>
			</coordinateSystem>
		</point>
	</item>
</routeStops>
</pre>

Here is what I would like to be sending:

<pre>
<routeStops xsi:type="soapenc:Array" soapenc:arrayType="ns13:RouteStop[2]">
	<item>
	   <point>
		  <x xsi:type="xs:double">-123.335816</x>
		  <y xsi:type="xs:double">48.420692</y>
		  <coordinateSystem>
			 <projection xsi:type="xs:string">4326</projection>
			 <datumTransformation xsi:type="xs:string"></datumTransformation>
		  </coordinateSystem>
	   </point>
	</item>
	<item>
	   <description xsi:type="xs:string">test</description>
	   <point>
		  <x xsi:type="xs:double">-123.392048</x>
		  <y xsi:type="xs:double">48.483424</y>
		  <coordinateSystem>
			 <projection xsi:type="xs:string">4326</projection>
			 <datumTransformation xsi:type="xs:string"></datumTransformation>
		  </coordinateSystem>
	   </point>
	</item>
</routeStops>
</pre>

Here is part of the code used to construct the outgoing payload:

$routeStops[0]->point->x = -123.335816;
$routeStops[0]->point->y = 48.420692;
$routeStops[0]->point->coordinateSystem->projection = "4326";
$routeStops[1]->point->x = -123.392048;
$routeStops[1]->point->y = 48.483424;
$routeStops[1]->point->coordinateSystem->projection = "4326";

$routeStops = new SOAP_Value("routeStops", "{urn}RouteStop", $routeStops);

I am trying to get the outbound payload to be an array of type RouteStop,
but it's being sent as an array of type Struct.

This is happening in Base.php's _getType() method.

I am pretty sure that this is because I'm misusing new SOAP_Value(), but
no matter what I provide as the second parameter to SOAP_Value's
constructor, it doesn't seem to take.

Any pointers would be appreciated.

Greg Froh
http://greg.froh.ca

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux