Click here to Skip to main content
12,452,015 members (35,805 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# 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.2K
Updated 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 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 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160826.1 | Last Updated 9 Feb 2012
Copyright © CodeProject, 1999-2016
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