i need a help from you.
i have developed a web service using c#. and i want to access it from a php page. i am giving the code i am using but still not working.
the webservice has a simple sum method which returns a integer value
require_once('nusoap.php');
$proxyhost = 'MYHOST';
$proxyport = '8080';
$proxyusername = 'username';
$proxypassword = 'pass';
$wsdl="http://localhost/testwebservice/service.asmx?wsdl";
try
{
$client=new nusoap_client($wsdl,false);
}
catch(Exception $e)
{
printf("Message = %s\n",$e->getMessage());
}
$params = array(
'a' => 2,
'b' => 4,
);
try
{
$result = $client->call('sum',array('parameters' => $params));
}
catch(EXception $e1)
{
printf("Message = %s\n",$e1->getMessage());
}
if ($client->fault)
{
echo '
Fault
';';
print_r($result);
echo '
}
else
{
// Check for errors
$err = $client->getError();
if ($err)
{
// Display the error
echo '
Error
' . $err . '';
} else
{
// Display the result
echo '
Result
';';
print_r($result);
echo '
}
}
echo '
Request
' . htmlspecialchars($client->request, ENT_QUOTES) . '';
echo '
Response
' . htmlspecialchars($client->response, ENT_QUOTES) . '';
echo '
Debug
' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '';
?>
please help me guyz
Guest UserPosted Jul 1, 2008, 2:23 PM
$client=new nusoap_client($wsdl,false);
Try this instead:
$client=new nusoap_client($wsdl,'wsdl');