Created
September 1, 2014 13:36
-
-
Save javiervivanco/7fec69c51152ece265e0 to your computer and use it in GitHub Desktop.
Definir un tipo array para Server NuSoap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ... Server NuSoap | |
$server->wsdl->addComplexType( | |
'Product', | |
'complexType', | |
'struct', | |
'all', | |
'', | |
array( | |
'Name' => array('name'=>'name','type'=>'xsd:string'), | |
'Code' => array('name'=>'product_number','type'=>'xsd:string'), | |
'Price' => array('name'=>'price','type'=>'xsd:decimal'), | |
'Ammount' => array('name'=>'quantity','type'=>'xsd:int') | |
) | |
); | |
$server->wsdl->addComplexType( | |
'ProductArray', | |
'complexType', | |
'array', | |
'', | |
'SOAP-ENC:Array', | |
array(), | |
array( | |
array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Product[]') | |
), | |
'tns:Product' | |
); | |
$server->register( | |
'GetProductsByCode', | |
array('user'=>'xsd:string','password'=>'xsd:string','product_code'=>'xsd:string'), | |
array('return'=>'tns:ProductArray'), | |
$NAMESPACE); | |
//http://share.ez.no/forums/developer/nusoap-registering-complex-data-types |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment