API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

PHP using the functions with GetDataArray

0
Hello.

I am a little stuck on a problem.
In the web service definition from for example OrderLine_GetDataArray ( https//wwwe-conomiccom/secure/api1/EconomicWebserviceasmx?op=Order_GetDataArray )

There is following format:


entityHandles
        OrderHandle
          Idint/Id
        /OrderHandle
        OrderHandle
          Idint/Id
        /OrderHandle
      /entityHandles



The problem is to generate an array from PHP, which have multiple identicals tags as the the format is requesting.

For example:

$t = array(entityHandles  =
                array(    'OrderHandle' = array('Id' = '7' ),
                          'OrderHandle' = array('Id' = '10'),
                          'OrderHandle' = array('Id' = '17')
                        )
               );
print_r($t);


Result:

Array
(
    entityHandles = Array
        (
            OrderHandle = Array
                (
                    Id = 17
                )

        )

)


Anyone knows how to handle this? so i can send an soap request with multiply identical tags (OrderHandle)
created Dec 16, 2009 by ksvendsen
20% Accept Rate
Q 6 A 12 C 1

2 Answers

0
I guess i can do something like, done in:

how-can-i-use-debtor-createfromdata--t926.html-sid=2945f9da5e8c06438a66ab91fb1cb3b3
answered Dec 25, 2009 by ksvendsen
0
I know this is an old thread. But I just spent a few hours trying to get GetDataArray to work.

This worked for me:

$tname = 'ProductGroup';
$GetAll = $tname'_GetAll';
$Handle = $tname'Handle';
$GetDataArray = $tname'_GetDataArray';
$Data = $tname'Data';
$handles = $client-$GetAll();
$handles = $handles-$Handle;
$handles = (array)$handles;
$dataObjects = $client-$GetDataArray(array('entityHandles' = array($Handle = $handles)))-$Data;

/Kjeld
answered Jul 23, 2012 by ecodyr
Visma e-conomic A/S
...