PHP Call Java webservice_php Tutorial

Source: Internet
Author: User
Web site 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 the 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 "program returns:", Print_r (Array_count_values ($STR));

} else {
echo "Error:", $err;
}

?>

which

' URI ' is namespace.

' arg0 ' is the default parameter name and cannot be changed.

The parameters of the Java Web site promotion method must be of type object. (fblww-0312)


From Internet Marketing

http://www.bkjia.com/PHPjc/478323.html www.bkjia.com true http://www.bkjia.com/PHPjc/478323.html techarticle Web site Promotion in Java WebService Method: Public String Findcode (Object code) {Elementnsimpl Ens = (elementnsimpl) code; String num = ens.gettextcontent (); SYSTEM.OUT.PRINTLN (code) ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.