Re: Nestled type

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

 



Hi Moritz,

I'm not sure how you defined your classes, but from the complexType's
definition you provided I basically would be doing the following:

class GetModifiedOrdersInput {
	public $QueryRequestHeader; // que:queryRequestHeader
	public $FromDate; // xs:dateTime
	public $ToDate; // xs:dateTime
	public $OrderQueryOptions; // que:orderQueryOptions
}

class queryRequestHeader {
	public $PartnerCode; // xs:string
        public $AuthToken; // que:authToken
        public $ReplayToken; // xs:string
        public $UseReplayToken; // xs:boolean
}

class orderQueryOptions {
	public $ReturnProductDetail; // xs:boolean
	public $ReturnContacts; // xs:boolean
        public $ReturnCertificateInfo; // xs:boolean
	public $ReturnFulfillment; // xs:boolean
        public $ReturnCACerts; // xs:boolean
        public $ReturnOrderAttributes; // xs:boolean
}

$query_opts = new orderQueryOptions();
$query_opts->ReturnContacts = true;

$header = new queryRequestHeader();
$header->PartnerCode = 'topsecret';

$request = new GetModifiedOrdersInput();
$request->QueryRequestHeader = $header;
$request->OrderQueryOptions = $query_opts;

$client = new SoapClient($wsdl, array('trace' => 1, 'exceptions' => 0,
'classmap' => array('GetModifiedOrdersInput' =>
'GetModifiedOrdersInput', 'queryRequestHeader' => 'queryRequestHeader',
'orderQueryOptions' => 'orderQueryOptions')));

$result = $client->someFunction($request);

print 'Request: '.$client->__getLastRequest();
print 'Response: '.$client->__getLastResponse();

var_dump($result);

ext/soap handles nested classes, use classmap to explicit say what PHP
class you want as response, else ext/soap will return stdClass.

Manually typing all the PHP class code from WSDL types is what I try to
avoid in wsdl2php.

Regards,
Knut Urdalen
Software Developer
Telio AS

-- 
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