Issue passing in Option for Web Service parameter

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rewster1976
Forum Newbie
Posts: 1
Joined: Mon Aug 21, 2006 1:03 pm

Issue passing in Option for Web Service parameter

Post by rewster1976 »

Hi,

I am using NuSOAP to call a third party Web service from php 4. Using the code below I am able to sucessfully send in a request and get back a response. However I need to tweak one of the input parameters.

In XML The Web Service is expecting: <Engine Flatten="True">Verification</Engine> instead of just <Engine>Verification</Engine>. How can I specify the ' Flatten = "True' option using the call method in NuSOAP?

Any pointers appreciated.

Best Regards,

Andrew

Code: Select all

<?
require_once('nusoap.php');
// Create the client instance
$client = new soapclient('http://localhost:2021/', false);

// Set params
$namespace='http://www.qas.com/web-2005-02';
$soapaction='http://www.qas.com/web-2005-02/DoSearch';
$params = array('Country'=>'USA','Engine'=>'Verification','Layout'=>'Database layout','Search'=> '1889 broadway,94109','Promptset'=> 'default');

// Set encoding to utf-8
$client->soap_defencoding = 'UTF-8';

// Call the SOAP method
$response = $client->call('QASearch', $params, $namespace, $soapaction);

// Display the result
print_r($response);
// Display the request and response
echo '<h2>Request</h2>';
echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2>';
echo '<pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
?>
Post Reply