this is the php code i'm running on the server
<?php
require_once('lib/nusoap.php');
$request = "http://www.webserviceX.NET/GetWeather";
$location = "http://www.webservicex.net/globalweather.asmx";
$action = "tns:GetWeatherSoapIn";
//$version = "5.0.1";
$version = "0.7.3";
class mySoap extends SoapClient
{
public function __doRequest($request, $location, $action, $version)
{
$result = parent::__doRequest($request, $location, $action, $version);
//$result = str_replace('<key xsi:type="xsd:int">', '<key xsi:type="xsd:string">', $result);
return $result;
}
}
//$abc = new mySoap(
$res = __doRequest($request, $location, $action, $version);
echo "<br/>weather report info :<br/>".$res;
?>
This is the error :
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in C:\Inetpub\vhosts\myw3portal.com\httpdocs\weatherreport.php on line 14
can someone resolve my problem?
php webservices code error
Moderator: General Moderators
-
venkatesh.svs
- Forum Newbie
- Posts: 12
- Joined: Wed Jan 06, 2010 1:30 am
-
Daniel03155
- Forum Newbie
- Posts: 3
- Joined: Sat Nov 07, 2009 9:06 pm
Re: php webservices code error
Do you even know php?
Re: php webservices code error
Do you?Daniel03155 wrote:Do you even know php?
venkatesh: are you running PHP 4? You need PHP 5.
-
venkatesh.svs
- Forum Newbie
- Posts: 12
- Joined: Wed Jan 06, 2010 1:30 am
Re: php webservices code error
we are running php 5.2.9 on wamp server
Re: php webservices code error
Which line is actually generating the error? Is the error on this page or is it being generated somewhere else?
-
Daniel03155
- Forum Newbie
- Posts: 3
- Joined: Sat Nov 07, 2009 9:06 pm
Re: php webservices code error
I asked because he was calling a method without instantiating the class first.
Yes. What does php 4 have to do with it ? It's a syntax error. Probably he's not pasting the entire code, or the error is somewhere else like JNettles said.tasairis wrote:Do you?Daniel03155 wrote:Do you even know php?
venkatesh: are you running PHP 4? You need PHP 5.
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: php webservices code error
Because this error is generated because of the 'public' keyword on line 14 which doesn't exist in PHP < 5.Daniel03155 wrote:I asked because he was calling a method without instantiating the class first.
Yes. What does php 4 have to do with it ? It's a syntax error. Probably he's not pasting the entire code, or the error is somewhere else like JNettles said.tasairis wrote:Do you?Daniel03155 wrote:Do you even know php?
venkatesh: are you running PHP 4? You need PHP 5.
venkatesh.svs
Code: Select all
echo PHP_VERSION;mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.