I have a simple ASP .NET web service running and I want call it from a php client. I m using nusoap soap client.
The following is the client side php code:
<?php
require_once('lib/nusoap.php');
$wsdl="http://localhost:64226/Service1.asmx?wsdl";
$client=new soapclient($wsdl, 'wsdl');
$param=array('number1'=>'2', 'number2'=>'3');
echo $client->call('add',$param);
?>
The web methods I have created in web service are as follows:
namespace WebService3
{
/// <summary>
/// Summary description for Service1
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class Service1 : System.Web.Services.WebService
{
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
[WebMethod]
public string add(int x, int y)
{
int z = x + y;
return z.ToString();
}
}
}
However when I run the above php code it does not return the added value of the passed parameters. Instead it previews the word 'Arrays'
I m not experienced in php programming. Am I doing something wrong the above codes? Need a quick solution to resolve this and invoke the web service from php.
Thanks in advance !