0

I'm trying to make request to soap server, my data is:

[0] => Array
    (
        [fid] => 1
        [fvalueString] => Knaanic Language Structure Historical Background
        [fvalueInt] => 0
        [fvalueFloat] => 0
        [fvalueImage] => 0
        [fvalueDatetime] => 0
        [fvalueDate] => 
        [fvalueRangeInt] => Array
            (
                [fvalueRangeIntMin] => 0
                [fvalueRangeIntMax] => 0
            )

        [fvalueRangeFloat] => Array
            (
                [fvalueRangeFloatMin] => 0
                [fvalueRangeFloatMax] => 0
            )

        [fvalueRangeDate] => Array
            (
                [fvalueRangeDateMin] => 
                [fvalueRangeDateMax] => 
            )

    )

[1] => Array
    (
        [fid] => 2
        [fvalueString] => 
        [fvalueInt] => 6708
        [fvalueFloat] => 0
        [fvalueImage] => 0
        [fvalueDatetime] => 0
        [fvalueDate] => 
        [fvalueRangeInt] => Array
            (
                [fvalueRangeIntMin] => 0
                [fvalueRangeIntMax] => 0
            )

        [fvalueRangeFloat] => Array
            (
                [fvalueRangeFloatMin] => 0
                [fvalueRangeFloatMax] => 0
            )

        [fvalueRangeDate] => Array
            (
                [fvalueRangeDateMin] => 
                [fvalueRangeDateMax] => 
            )

    )

[2] => Array
    (
        [fid] => 3
        [fvalueString] => 
        [fvalueInt] => 0
        [fvalueFloat] => 0
        [fvalueImage] => 0
        [fvalueDatetime] => stdClass Object
            (
                [serverTime] => 1504262612
            )

        [fvalueDate] => 
        [fvalueRangeInt] => Array
            (
                [fvalueRangeIntMin] => 0
                [fvalueRangeIntMax] => 0
            )

        [fvalueRangeFloat] => Array
            (
                [fvalueRangeFloatMin] => 0
                [fvalueRangeFloatMax] => 0
            )

        [fvalueRangeDate] => Array
            (
                [fvalueRangeDateMin] => 
                [fvalueRangeDateMax] => 
            )

    )

)

there are more fields but all fields look same as above. I'm trying make soap call with php SoapClient with __call method:

$this->_client->doCheckNewAuctionExt( array(
            'sessionHandle' => $this->_session['sessionHandlePart'],
            'fields' => $fields
        )
    );

Where $fields is array with data which i posted above and _session is sessionId which I had obtain with another request. Server gives me error, when I checked the request xml it looks:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:ns1="https://webapi.aukro.cz/service.php"><SOAP-ENV:Body>
<ns1:DoCheckNewAuctionExtRequest>
<ns1:sessionHandle>my session Id is passed correctly</ns1:sessionHandle>
<ns1:fields/></ns1:DoCheckNewAuctionExtRequest>
</SOAP-ENV:Body></SOAP-ENV:Envelope>

Why are empty? Here is wsdl: https://webapi.aukro.cz/?wsdl


edited:

I had found solution, I don't know why but works:

    $req=[];
    foreach ($Fields as $field){
        $req[]=$field;
    }
    $response = ($this->_client->doCheckNewAuctionExt(array(
            'sessionHandle' => $this->_session['sessionHandlePart'],
            'fields' =>  $req)))
  • can you try to wrap `$fields` with a key? eg. 'fields' => array('fields' => $fields) – Ben Dec 08 '17 at 16:44
  • not working, still are ampty – Rafal Wegrzyniak Dec 12 '17 at 13:05
  • how do you initialize the soapclient, with enable trace, cache_wsdl sets to WSDL_CACHE_NONE, and correct soap_version? – Ben Dec 12 '17 at 13:51
  • related link: https://stackoverflow.com/questions/3780543/how-to-pass-an-array-into-a-php-soapclient-call – Ben Dec 12 '17 at 13:52
  • here is my client initialization: $this->_client = new SoapClient(ALLEGRO_WSDL, array('trace'=>true, 'soap_version'=>SOAP_1_1, 'exceptions'=>true, 'cache_wsdl'=>WSDL_CACHE_NONE, 'use' => SOAP_LITERAL, 'style' => SOAP_DOCUMENT )); – Rafal Wegrzyniak Dec 12 '17 at 14:35
  • When I try onedimensional array array('test', 'test1') api responsed me that my request don't have field's fid, fvalueInt etc. That's strange for me because of fact that when I pass array from post I had another error. Maybe array had been sended to API but is not in xml obtained with __getLastRequest, but this explaination does not make sense to me – Rafal Wegrzyniak Dec 12 '17 at 14:54

0 Answers0