Reply to Problems with classmap in ext/soap

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация