php calls java webservice_PHP tutorial
Jul 13, 2016 pm 05:49 PM
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:
<?php
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

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

How To Set Up Visual Studio Code (VS Code) for PHP Development

PHP Program to Count Vowels in a String

Break or return from Java 8 stream forEach?

How do you parse and process HTML/XML in PHP?

Java Made Simple: A Beginner's Guide to Programming Power

Create the Future: Java Programming for Absolute Beginners

Java Program to Find the Volume of Capsule
