Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET PHP C#4.0
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 
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 8-Feb-12 20:10pm
comred1.1K
Edited 9-Feb-12 2:30am
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

The PHP class name is SoapClient[^], not SOAP_WSDL.
  Permalink  
Comments
comred at 9-Feb-12 8:20am
   
Yah.. I wrote soapclient after this. but getting now new error. I am updating my code ..
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Remove the class definition block around your code. You are simply executing a sequence of PHP statements, not defining a new class.
  Permalink  
Comments
comred at 10-Feb-12 0:08am
   
ok.. I will try and update here. Thanks a lot.
+5
comred at 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 at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 271
1 OriginalGriff 253
2 nv3 50
3 VJ Reddy 45
4 Mehdi Gholam 45
0 Sergey Alexandrovich Kryukov 6,696
1 OriginalGriff 6,149
2 CPallini 2,473
3 Richard MacCutchan 1,697
4 Abhinav S 1,560


Advertise | Privacy | Mobile
Web03 | 2.8.140821.2 | Last Updated 9 Feb 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100