开发者

inserting string into Soapclient

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.开发者_如何学JAVAcms.gre.ac.uk/dd615/' .
    'aspweb/WatCoursework/Service.asmx?WSDL');
$xmlString = $client->getMusicdetailsSql()->getMusicdetailsSqlResult->$searchTerm;


$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)));
...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜