|
Posted by Thomas Johansen on 10/05/06 16:27
Got an annoying issue with the classmap feature in ext/soap; I'm
returning a Response object that has an array of Result objects, and I
am attempting to classmap them.
It works like a charm for the Response object, but fails miserably for
the array.
Anyone got any bright ideas? (Below are the relevant code and schema snippets)
<xsd:element name="flightsResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded"
name="flight" type="tns:flight"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="flight">
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="1" name="flightCode"
type="xsd:string" />
<xsd:element minOccurs="1" maxOccurs="1" name="fromCode"
type="xsd:string" />
<xsd:element minOccurs="1" maxOccurs="1" name="toCode"
type="xsd:string" />
<xsd:element minOccurs="1" maxOccurs="1" name="departureTime"
type="xsd:dateTime" />
<xsd:element minOccurs="1" maxOccurs="1" name="arrivalTime"
type="xsd:dateTime" />
<xsd:element minOccurs="1" maxOccurs="1"
name="numAvailableSeats" type="xsd:integer" />
<xsd:element minOccurs="1" maxOccurs="1" name="price"
type="xsd:float" />
</xsd:sequence>
</xsd:complexType>
class FlightsResponse
{
public $flight;
public function __construct()
{
$this->flight = array();
}
public function addFlight($flight)
{
$this->flight[] = $flight;
}
}
class Flight
{
public $flightCode;
public $fromCode;
public $toCode;
public $departureTime;
public $arrivalTime;
public $numAvailableSeats;
public $price;
public function __construct()
{
}
}
$classmap = array(
"flightsResponse" => "FlightsResponse",
"flightsRequest", "FlightsRequest",
"flight", "Flight"
);
--
Thomas Johansen
Navigation:
[Reply to this message]
|