Consumir webservice enviando uma array
Boa tarde galera,
Estou precisando de uma ajuda pra consumir um webservice.
O webservice que vou consumir precisa receber um array com alguns dados de cotações, a estrutura é essa abaixo:
tenho que montar essa tag cotacoes, depois aretcot e ai sim inserir os registro dentro dessa tag cots
lembrando que preciso mandar mais de um registro e também não sei exatamente como fazer isso, tentei adicionar tudo numa array e mandar mas também não funcionou.
fiz da forma abaixo mas da esse erro: atal error: Uncaught SoapFault exception: [sender] WEBSERVICE ERROR : Argument Missing : Required field ARETCOT not found. in C:\xampp\htdocs\sendcots.php:37 Stack trace: #0 C:\xampp\htdocs\sendcots.php(37): SoapClient->__soapCall('UPDCOT', Array) #1 {main} thrown in C:\xampp\htdocs\sendcots.php on line 37
$client = new SoapClient ( "[http://187.50.7.74:90/WSRETCOT.apw?WSDL](http://187.50.7.74:90/WSRETCOT.apw?WSDL)" );
$function = 'UPDCOT';
$arguments = array (
'Logar' => array (
'_CLOGIN' => $_SESSION ['user'],
'_CPASSWORD' => $_SESSION ['pass'],
'COTACOES' => array ( 'ARETCOT' => array (
'CEMP' => "SP" ,
'CSTATUS' => "P",
'NREGISTRO' => 11111
)
)));
Requisição SOAP */applications/core/interface/imageproxy/imageproxy.php?img=http://187.50.7.74:90/images/transparente.gif&key=73be2248e307e1341973c75e68c263eddba4ec725b347377985e4f2b2360853b" width="5" alt="transparente.gif" />/applications/core/interface/imageproxy/imageproxy.php?img=http://187.50.7.74:90/images/transparente.gif&key=73be2248e307e1341973c75e68c263eddba4ec725b347377985e4f2b2360853b" width="1" alt="transparente.gif" />
<?xml version="1.0" encoding="utf-8"?"
<soap:Envelope xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance"](http://www.w3.org/2001/XMLSchema-instance)
xmlns:xsd="[http://www.w3.org/2001/XMLSchema"](http://www.w3.org/2001/XMLSchema)
xmlns:soap="[http://schemas.xmlsoap.org/soap/envelope/">](http://schemas.xmlsoap.org/soap/envelope/)
<soap:Body>
<COTACOES>
<ARETCOT>
<COTS>
<CEMP>**STRING**</CEMP>
<CSTATUS>**STRING**</CSTATUS>
<NREGISTRO>**FLOAT**</NREGISTRO>
</COTS>
<COTS>
<CEMP>**STRING**</CEMP>
<CSTATUS>**STRING**</CSTATUS>
<NREGISTRO>**FLOAT**</NREGISTRO>
</COTS>*
</ARETCOT>
</COTACOES>
<_CLOGIN>**STRING**</_CLOGIN>
<_CPASSWORD>**STRING**</_CPASSWORD>
</soap:Body>
</soap:Envelope>
Quer puder dar essa força, agradeço.
Muito obrigado!
Discussão (1)
Carregando comentários...