Jump to content

using an array created from db records in soap


coderex

Recommended Posts

I'm trying take an array I've created and place it in a soap command,   like this

 

 

while ($row2 = $db->getResult()) {
 
  $search_query[] = new SoapStructAuthorisationData($row2['rfid'],array(new SoapStructIdTagInfo('ConcurrentTx')));
 }
 

 

 

I then create a comma between each instance -

 

 

 

  while ($i <= $number) {
    
        if ($i < $number-1) { $comma=","; }
        else {$comma="";}
        
        $search[] = $search_query[$i].$comma;
       
  $i=$i+$t;
    }
 

 

 

 this the soap call which doesn't work , refering to the $search[] array above

 

if($soapServiceSend->SendLocalList(new SoapStructSendLocalListRequest($updateType,
         $listversion,
           array( $search)
     )))
 

 

 

this is what it's trying to create, showing 2 records

 

 

if($soapServiceSend->SendLocalList(new SoapStructSendLocalListRequest($updateType,
         $listversion,
           array( new SoapStructAuthorisationData(B4DTY,array(new SoapStructIdTagInfo('ConcurrentTx'))),new SoapStructAuthorisationData(CRO934,array(new SoapStructIdTagInfo('ConcurrentTx'))))
     )))
 

 

 

 

it's interesting that it works manually using the array like this below, but obviously as I don't know how many records there maybe, this won't work in a practical way 

 

if($soapServiceSend->SendLocalList(new SoapStructSendLocalListRequest($updateType,
         $listversion,
           array( search_query[0],search_query[1],search_query[2])
     )))

 

 

Does anyone have any ideas how I can get that array in successfully please. thanks

Edited by coderex
Link to comment
Share on other sites

What's the meaning of that while?

The $search will just be and array like $search_query but with comas at the end. So, I think you should just use $search_query instead of `array( $search)`

 

However, you can just add some var_dump after some lines and check what you get from your vars.

Edited by vectorialpx
Link to comment
Share on other sites

I need to separate with a comma, doesn't matter if I do it

 

What's the meaning of that while?

The $search will just be and array like $search_query but with comas at the end. So, I think you should just use $search_query instead of `array( $search)`

 

However, you can just add some var_dump after some lines and check what you get from your vars.

 

yes exatly but the result is still a big fat nothing

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.