Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create array for db result place in soap command

Status
Not open for further replies.

gavray

Programmer
Jul 17, 2000
65
0
0
GB
I'm trying take an array I've created and place it in a soap command, like this



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



I then create a comma between each instance just separated from above to avoid confusion-



Code:
  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



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



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


Code:
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



Code:
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

the boho from soho
 
you probably need to supply more information. such as the documentation for the various soap classes you are using and the soap api (the wsdl) for the endpoint you are using.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top