Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi.

To be frank I don't know PHP. But the problem I am facing is, I have my web service created in C# and ASP.Net and to check whether my service is platform independent I am trying to consume it in as PHP client.

What I tried is:

PHP
<?php 
class myphpclass extends nusoap_client
{
        require_once('../lib/nusoap.php');
	$wsdl = "http://www.abc.com/chkuser/checkuser.asmx?wsdl";
	$string = "pqr@gmail.com";
	$client = new nusoap_client($wsdl,true);
	print "<p> Hello :";
	$var = $client->call('findusername',$string);
	print $var;
			
}
?>


Its giving
Quote:
Parse error: syntax error, unexpected T_REQUIRE_ONCE, expecting T_FUNCTION


so plz help.
Posted
Updated 9-Feb-12 2:30am
v3

The PHP class name is SoapClient[^], not SOAP_WSDL.
 
Share this answer
 
Comments
comred 9-Feb-12 8:20am    
Yah.. I wrote soapclient after this. but getting now new error. I am updating my code ..
Remove the class definition block around your code. You are simply executing a sequence of PHP statements, not defining a new class.
 
Share this answer
 
Comments
comred 10-Feb-12 0:08am    
ok.. I will try and update here. Thanks a lot.
+5
comred 10-Feb-12 0:51am    
Would you tell me how to give the reference of "wsdl" service in php client.
I searched on net and they are talking about "nusoap library". Is it necessary to go for it? And if yes. then would you give some sample if you have. On Google it is there but all are complicated.
markkuk 13-Feb-12 7:00am    
No, nusoap isn't necessary if your PHP server supports the PHP SOAP extension There's also the PEAR SOAP package. Choose one of the three libraries and stick with it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900