php5 apache 2.2 webservice 创建与配置(java)
php 5 apache 2.2 webservice 创建与配置 1 写webservice 要用到的接口<div class="codetitle"><a style="CURSOR: pointer" data="81191" class="copybut" id="copybut81191" onclick="doCopy('code81191')"> 代码如下:<div class="codebody" id="code81191"> <?php 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',test_db'); //$db = new cls_mysql('211.103.156.227:3306','txtx',test_db'); //'testwsdl.wsd需要在后面采用Zend Studio生成。 $server=new SoapServer('testwsdl.wsdl',array('uri' => 'http://webserver.com/','encoding'=>'utf-8','soap_version' => SOAP_1_2 )); $server->setClass("service"); $server->handle(); ?> 2.wsdl
File--Export---php “wsdl file” 1
File name wsdl Exported files php Classes service URL
global settings 3 RPC – Oriented ok “Finish”
4
wsdl
() apache xml chrome wsdl ie firfox
wsCaller.jar JDK wsCaller.jarwsCaller.jar php
Php soap php 5.X php.ini extension=php_soap.dll( ) apache apache mime.types
message name=””
1 |
2
3
4