Skip to content

Instantly share code, notes, and snippets.

@javiervivanco
Created September 1, 2014 13:36
Show Gist options
  • Save javiervivanco/7fec69c51152ece265e0 to your computer and use it in GitHub Desktop.
Save javiervivanco/7fec69c51152ece265e0 to your computer and use it in GitHub Desktop.
Definir un tipo array para Server NuSoap
<?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