Home > Backend Development > PHP Tutorial > php calls java webservice_PHP tutorial

php calls java webservice_PHP tutorial

WBOY
Release: 2016-07-13 17:49:41
Original
1012 people have browsed it

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)


Excerpted from Internet Marketing

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478323.htmlTechArticleWebsite promotion Webservice method in Java: public String findCode(Object code) { ElementNSImpl ens = (ElementNSImpl)code; String num = ens.getTextContent(); System.out.println(code)...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template