Re: AW: AW: AW: WSDL error can someone help
Hi. I had the same problems as discussed in this thread. Although my problem
did not solve yet. here is my code.....
Server code: stockserver.php
<?php
function getStockQuote($symbol) {
return "Hello $symbol";
}
require('lib/nusoap.php');
$server = new soap_server();
$server->configureWSDL('stockserver', 'urn:stockquote');
$server->register("getStockQuote",
array('symbol' => 'xsd:string'),
array('response' => 'xsd:string'),
'urn:stockquote',
'urn:stockquote#getStockQuote');
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA)
? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>
Client code: stockclient.php
<?php
require_once('lib/nusoap.php');
$client = new
nusoap_client("http://localhost/soaptest/stockserver.php?wsdl", true);
//$response = $client->call('getStockQuote',
// array('symbol' => 'ABC'));
$proxy = $client->getProxy();
$response = $proxy->getStockQuote('ABC');
if($client->fault)
{
echo "FAULT: <p>Code: (".$client->faultcode.")</p>";
echo "String: ".$client->faultstring;
}
else
{
echo $response;
}
?>
But nothing is shown on screen and no SOAP error! Can anyone help!
Thanks.
usuario76 wrote:
>
> Thank you Christian!. You helped me much!
>
>
> Christian Wenz-4 wrote:
>>
>>
>>> $c = new
>>> soapclient('http://localhost/distribsys/newtest/server.php?wsdl');
>>
>> Aah, didn't spot that at first. SoapClient is from PHP5's SOAP extension.
>> Use nusoap_client instead.
>>
>> If you want to use SoapClient, omit the getProxy() call.
>>
>> --Christian
>>
>> --
>> PHP Soap Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/WSDL-error-can-someone-help-tp14985983p24012782.html
Sent from the Php - Soap mailing list archive at Nabble.com.
--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[PHP Home]
[PHP Users]
[Kernel Newbies]
[PHP Database]
[Yosemite]