Jump to content

struggling!


westminster86

Recommended Posts

$soap = new SoapClient('http://');  // wsdl code shows where the SOAP server code is expected to be found

  try {
    $avalue = $soap->getinfo();  // call the getinfo method in the soap object
    } catch (SoapFault $ex) {
    echo $ex->faultstring;
  }

  print $avalue;

 

Im reading in a text string via a SOAP sever called from a client. So in the above $avalue holds the text string from the getinfo function declared in the SOAP server. My question is, how would i get round reading in data from other SOAP services? So, for example after reading in $avalue, i get data from

$soap = new SoapClient('http://This time round a different directory');

 

Should i be using a loop of some sort, so that after its read in the text string from one directory it fetches in another from a different SOAP server.

 

Link to comment
Share on other sites

How would i write a loop that reads in the first variable(hello), does something with the variable, then comes back round the loop and reads in the second variable(bye).

 

<?php

  $variable1 = 'hello';
  $variable2 = 'bye';
  $arr = array($variable1,$variable2);
  foreach ($arr as $v) {
    // do something.
    echo $v;
  }

?>

Link to comment
Share on other sites

That's not what the OP is looking for.

 

If you don't know how many variables you are going to have, start with an empty array and add to it as you get the values:

<?php
$ar = array();
$ar[] = 'some value';;
$ar[] = getanotherval();
$ar[] = 'some other value';
//
// process
//
foreach($ar as $val) {
//
//  do something
//
}?>

 

Ken

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.