Re: [SOAP] WSDL error can someone help
| From: | kirkfrusciante | Date: | Sat, 01 Dec 2012 16:29:56 +0000 |
| Subject: | Re: [SOAP] WSDL error can someone help | ||
| References: | 1 2 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-3378@lists.php.net to get a copy of this message | ||
Hi,
I have a similar problem on my first test of webservice..the problem is that
there are no errors but it seems like if the the server.php page doesn't
work...here is the code..if you could help me :)
Server.php
<?php
function getStockQuote($nome) {
mysql_connect('localhost','root');
mysql_select_db('mio');
$query = "SELECT * FROM nomi WHERE nome = '$nome' ";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)){
}
}
require('nusoap.php');
$server = new nusoap_server();
$server->configureWSDL('stockquote', 'urn:stockquote');
$server->register("getStockQuote",
array('symbol' => 'xsd:string'),
array('return' => 'xsd:string'),
'urn:stockquote',
'urn:stockquote#getStockQuote');
if ( !isset( $HTTP_RAW_POST_DATA ) ) $HTTP_RAW_POST_DATA
=file_get_contents( 'php://input' );
$server->service($HTTP_RAW_POST_DATA);
?>
client.php
<html>
<body>
<form method="get" action="client.php">
ID: <input name="symbol" type="text" value="">
<br>
<br>
<input type="submit">
</form>
<?php
$symbol = $_GET['symbol'];
if ($symbol) {
require_once('nusoap.php');
//we create an array with the element name that has the form value of name
//now we must create a soapclient object
$c = new nusoap_client('serv.wsdl',true);
//now we call the server.
$stockprice = $c->call('getStockQuote',
array('symbol' => $symbol));
echo "Information for $symbol is $stockprice.";
}
?>
Thank you so much!
--
View this message in context: http://old.nabble.com/WSDL-error-can-someone-help-tp14985983p34746594.html
Sent from the Php - Soap mailing list archive at Nabble.com.