• My Errors
  • Login
  • Search
Search again

Error #81421

Hi,

If anyone has expertise with web services, please help.

Problem:

I developed a Java Web service using Netbeans 6.1. I deployed and tested it on Glassfish server. It worked fine in the test as web service. But when I try to consume(call) one of the web service's method from PHP, I am getting an error "Cannot find dispatch method for {}getMoreFriends", where getMoreFriends is the name of the method I am calling.

I am using nusoap-0.7.3 as SOAP platform.

Here is my php code:

<?php
require_once('nusoap.php');
echo "gaurang<br>";

$zip = "95112";
$param = array('zipcode' => $zip);

$wsdl = "http://localhost:8080/LocationWsApplication/moreFriendsService?WSDL";
$mynamespace = "http://localhost:8080/LocationWsApplication/moreFriendsService?xsd=1";

$client = new soapclient($wsdl, true);
$err = $client->getError();
if ($err) {
echo 'Constructor error' . $err;
}

$response = $client->call('getMoreFriends', $param, $mynamespace);
$err = $client->getError();
if ($err) {
echo 'Error in fetching data' . $err;
}
echo "<br>.......".$response."......<br>";

echo '<h2>Request</h2>';
echo '<pre>' . htmlspecialchars($client -> request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2>';
echo '<pre>' . htmlspecialchars($client -> response, ENT_QUOTES) . '</pre>';
echo '<h2>Debug</h2>';
echo '<pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
echo '<h2>Error</h2>';
echo '<pre>' . htmlspecialchars($client->getError(), ENT_QUOTES) . '</pre>';
echo '<h2>Fault</h2>';
echo '<pre>' . htmlspecialchars($client->fault, ENT_QUOTES) . '</pre>';


?>


Can anyone help?

User's solution

This works!
+1 Vote Up

yo need to specify namespace as third argument while making a call to 'call' method..

Nov 07, 2008

Comments

You need to get the latest version from cvs

user36814 Dec 02, 2008