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