Website promotion Webservice method in Java:
public String findCode(Object code) {
ElementNSImpl ens = (ElementNSImpl)code;
String num = ens.getTextContent();
System.out.println(code);
SqlSearch sqlSearch = new SqlSearch();
String result = sqlSearch.findCode(String.valueOf(num));
sqlSearch = null;
return result;
}
PHP calls Webservice method:
require_once("lib/nusoap.php");
$client = new soapclient('http://192.168.0.108:8080/data/DataPort?wsdl',array('uri'=>'http://ws.data.com/'));
$str=$client->call("findCode",array("arg0"=>"123456"));
if (!$err=$client->getError()) {
echo "The program returns:",print_r(array_count_values($str));
} else {
echo "Error:",$err;
}
?>
Among them:
'uri' is namespace.
'arg0' is the default parameter name and cannot be changed.
The parameters of Java website promotion method must be of Object type. (fblww-0312)