tags:

views:

11

answers:

1

Well as the question says am trying to insert a string value into a Soapclient request I know there should be some sort of term before the $searchTerm parameter, but I don't have a clue what it is any help would be much appreciated.

$searchTerm = $_GET['search'];
$client = new SoapClient('http://stuiis.cms.gre.ac.uk/dd615/' .
    'aspweb/WatCoursework/Service.asmx?WSDL');
$xmlString = $client->getMusicdetailsSql()->getMusicdetailsSqlResult->$searchTerm;
A: 
$searchTerm = $_GET['search']; // try searching for "Dixon";
$client = new SoapClient('http://stuiis.cms.gre.ac.uk/dd615/' . 
                         'aspweb/WatCoursework/Service.asmx?WSDL');
$response = $client->getMusicdetailsSql(array('searchTerm'=>$searchTerm));
echo $response->getMusicdetailsSqlResult->any;

At this point you'll need to parse the XML and go on from there. Its sometimes helpful to experiment and read out the value being stored in a variable to see what you can do with it. Try running the following to see more details about whats possible:

print_r($client->getMusicdetailsSql());
print_r($client->getMusicdetailsSql(array('searchTerm'=>$searchTerm)));
...
thetaiko
thanks for the help and the advice I will definitely look at the results of the second section of code and keep your advice in mind next time I have any problem >_<
dbomb101