Talk galley, blaze?
I'm developing a webservice php in soap, I'm using the nuSOAP library, the simple type tests were successful but now I need to test with complex types like bad arrays I can not make work, the error in the transmission, already includes a command forError description generated:
SOAP-ENV:Client: error in msg parsing: XML error parsing SOAP payload on line 1: Space required
The structure I send and I need to receive is this:
array (size=1) 'itens' => array (size=3) 'suco' => array (size=2) 0 => int 1 1 => string '1.90' (length=4) 'coca cola' => array (size=2) 0 => int 1 1 => string '4.99' (length=4) 'miojo' => array (size=2) 0 => int 5 1 => string '3.99' (length=4)
In the server.php file include this command to enable complex type:
$servidor->wsdl->addComplexType(
'onItens',
'complexType',
'struct',
'',
'SOAP-ENC:Array',
array(),
array(
'itens' => 'SOAP-ENC:arrayType',
'wsdl:arrayType' => 'xsd:string[]'
)
);
$servidor->register(
'WS.onLancamentos',
array('itens'=>'tns:onItens'),
array('retorno'=>'xsd:string'),
$namespace,
$namespace.'#lancamentos',
'rpc',
'encoded',
'Lancamento dos itens comprados na PEGGOU'
);
Obs : When the main array 'items' gets only one element, then the number of items is undefined, so I need to configure it to work with more elements.