Php5apache2.2webservice creation and configuration (java)

Source: Internet
Author: User
To run wsCaller. jar, select to install jdk. If jdk is not installed, wsCaller. jar is displayed as a compressed package.

To run wsCaller. jar, select to install jdk. If jdk is not installed, wsCaller. jar is displayed as a compressed package.

Php 5 apache 2.2 webservice creation and Configuration
Test Tool: wsCaller. jar (this is the webservice called for java programs)
Tip: To Run wsCaller. jar, select to install jdk. If jdk is not installed, wsCaller. jar is displayed as a compressed package.
1. interface used to write webservice

The Code is as follows:


Class service
{
Function add ($ a, $ B ){
$ C = $ a + $ B;
Return $ c;
}
Function str ($ string ){
Return $ string;
}
}
// Require ('cls _ mysql. php ');
// $ Db = new cls_mysql ('localhost', 'root', 'root', test_db ');
// $ Db = new cls_mysql ('192. 103.156.227: 100', 'root', 'txtx ', test_db ');
// 'Testwsdl. wsd must be generated using Zend Studio later.
$ Server = new SoapServer ('testwsdl. wsdl ', array ('uri' => 'HTTP: // webserver.com/', 'encoding' => 'utf-8', 'soap _ version' => SOAP_1_2 ));
$ Server-> setClass ("service ");
$ Server-> handle ();
?>


Menu



SelectRPC-Oriented

Click "Finish"



The last step is Each parameter has a reasonable type ()

Then save

(The following content appears:)



Test whether the call is successful

Test Tool

WsCaller. jar

Do not decompressWsCaller. jar

RestartApache

Add new parameters to the Function

Directly copy and change the parameter name

WSDLFile


PhpInterface file

1 function add ($ a, $ B, $ e ){

2 $ c = $ a + $ B + $ e;

3 return $ c;

4}

Add new function

WSDL




PHP

The Code is as follows:


Function add_bak ($ a, $ B, $ e ){
$ C = $ a + $ B-$ e;
Return $ c;
}


Test Results

Add_bakFunction


AddFunction


Other functions will not be tested one by one.
If there is something wrong, please point out Thank you

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.