Hello friends, i am having a trouble, and the server is throwing me this:

*Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object hasn't 'Sdt_coleccionretornoitemsagrupacion' property in /var/www/sitios/webservices/Diego.php:129 Stack trace: #0 /var/www/sitios/webservices/Diego.php(129): SoapClient->__soapCall('Execute', Array) #1 {main} thrown in /var/www/sitios/webservices/Diego.php on line 129 *

I have this code:

        echo 'SEGUNDO XML------------------------------' . '<br/><br/>';
        $objClienteSOAP2 = new SoapClient('http://192.168.1.12:8080/geotributosval/servlet/agen?wsdl');
        //$newRecibos = json_decode($recibos, true);
        $params2 = array('Ipmaquina'=>'127.0.0.1', 'Concod'=>'1', 'Vartribmen1'=>'?', 'Vartribmen2'=>'?', 'Vartribmen3'=>'?',
        'coleccionretornoitemsagrupacion'=>array('IdTramite'=>1008,array('IdTributo'=>802,'NombreTributo'=>'CERTIFICADO','UnidadCodigo'=>1,
        'UnidadNombre'=>'PESOS','ValorTributo'=>256.00),'Cantidad'=>3));
        $objRespuesta2 = $objClienteSOAP2->__soapCall('Execute', array($params2));

        // var_dump($objClienteSOAP2->__getFunctions());
        echo '<pre>';
        print_r($objRespuesta2);
        echo '</pre>';

And the software that i use to test is workins well,

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:geot="GeoTribUy">
   <soapenv:Header/>
   <soapenv:Body>
      <geot:GenWs14GenerarCobroVarios.Execute>
         <geot:Ipmaquina>imstimbres</geot:Ipmaquina>
         <geot:Concod>1</geot:Concod>
         <geot:Vartribmen1>?</geot:Vartribmen1>
         <geot:Vartribmen2>?</geot:Vartribmen2>
         <geot:Vartribmen3>?</geot:Vartribmen3>
         <geot:Sdt_coleccionretornoitemsagrupacion>

            <geot:SDT_ColeccionRetornoItemsAgrupacion.SDT_ColeccionRetornoItemsAgrupacionItem>

               <geot:IdTramite>1008</geot:IdTramite>
               <geot:ColeccionRetornoItemsTributos>

                  <geot:SDT_ColeccionRetornoItemsTributos.SDT_ColeccionRetornoItemsTributosItem>

                     <geot:IdTributo>802</geot:IdTributo>
                     <geot:NombreTributo>CERTIFICADO</geot:NombreTributo>
                     <geot:UnidadCodigo>1</geot:UnidadCodigo>
                     <geot:UnidadNombre>PESOS</geot:UnidadNombre>
                     <geot:ValorTributo>256.00</geot:ValorTributo>
                     <geot:Cantidad>3</geot:Cantidad>
                     <geot:SubTotal>?</geot:SubTotal>
                  </geot:SDT_ColeccionRetornoItemsTributos.SDT_ColeccionRetornoItemsTributosItem>
               </geot:ColeccionRetornoItemsTributos>
            </geot:SDT_ColeccionRetornoItemsAgrupacion.SDT_ColeccionRetornoItemsAgrupacionItem>
         </geot:Sdt_coleccionretornoitemsagrupacion>
      </geot:GenWs14GenerarCobroVarios.Execute>
   </soapenv:Body>
</soapenv:Envelope>

I can not pass an Array into the Array of params, i hope i explain my self well. The last parameter is an array.

I am not seeing if i am loosing some code, or should i make something new?..

Please help me.

Cheers and greetings from Uruguay(South America).

Member Avatar for LastMitch

I am not seeing if i am loosing some code, or should i make something new?.

@DiTeN

The code you posted is incomplete. You can't expect anyone to read what you posted. It's all wrong and misleading. You need to post PHP code related to the issue you are having.

Your code should look something like this:

http://www.php.net/manual/en/soapclient.dorequest.php

or this:

http://www.php.net/manual/en/soapclient.getfunctions.php

I don't really know because you didn't provide enough information to pinpoint what is the issue.

The code you posted is incomplete.

It looks complete to me. The problem is that I cannot access the WSDL to try the code and soap method.

Hello, yes is complete. My problem is passing an array inside the param array in the variable 'coleccionretornoitemsagrupacio' in the fisrt code, line 5. Should that be ok?.

Member Avatar for LastMitch

Should that be ok?.

@DiTeN

Not really. But base on the code you provided your array should look like a basic array:

<?php
'1' => array(
    'Id' => 3,
    'Name' => 'ME',
),
?>

I think even though your software created the list but the list order might not read the array that you created. Try to separate the array and used the same list order and run it it should be fine.

I also can't run WSDL to try the code and soap method either.

So I am picturing the how looks. You have to tell us rather it was that array line that is preventing the script to running.

Have you tried to pass this?

$params2 = array
(
    'Ipmaquina' => '127.0.0.1', 
    'Concod' => '1', 
    'Sdt_coleccionretornoitemsagrupacion' => array 
    (
        array (
            'IdTramite' => 1008, 
            'ColeccionRetornoItemsTributos' => array 
            (
                array 
                (
                    'IdTributo' => 802, 
                    'NombreTributo' => 'CERTIFICADO', 
                    'UnidadCodigo' => 1, 
                    'UnidadNombre' => 'PESOS', 
                    'ValorTributo' => 256.00, 
                    'Cantidad' => 3
                )
            )
        )
    )
);

Thanks, i will try that way

Thanks you all!!, i wass missing a parameter.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.