1
Talk to you guys, blah?
I am developing a php webservice in Soap, I am using the nuSOAP library, the tests with simple type were successful but now I need to test with complex types as bad arrays I cannot make it work, from the transmission error, already includes a command to enable this bad guy I’m doing something wrong, if anyone can help I appreciate.
Description of the error generated:
SOAP-ENV:Client: error in msg parsing: XML error parsing SOAP payload on line 1: Space required
The structure I send and 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.php server file includes 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' is only with one element then it works badly the number of items is undefined, so I need to configure to work with more elements.