Skynet

---------- ---------- 我的新 blog : liukaiyi.cublog.cn ---------- ----------

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  112 Posts :: 1 Stories :: 49 Comments :: 0 Trackbacks

可能最简单的 soap 哦!
服务器为 java tomcat
下载服务器:http://www.apache.org/dist/ws/
   axis/ 为java
   axis-c/    为 c

1.我这下载的 axis 1_4 版本 ,解压 /webapps/axis  放到 tomcat 的webapps
启动tomcat(这就不修改任何,如有需要 该 web.xml 等配置了) 参考 >>
    blog 主 还有很多介绍 axis 大家可以 看看  日志 > 其下的 "学习"

直接写个文件 HelloWorld.jws 放到 %TOMCAT_HOME%"webapps"axis
public class HelloWorld {   
     
public String sayHello()   {   
     
return "HELLO soap!";    
 }    


等不及 可以使用 看看
http://127.0.0.1:8080/axis/HelloWorld.jws?method=sayHello
结果 :
<soapenv:Envelope>
<soapenv:Body>
<sayHelloResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<sayHelloReturn xsi:type="xsd:string">HELLO soap!</sayHelloReturn>
</sayHelloResponse>
</soapenv:Body>
</soapenv:Envelope>


客户段
perl cpan >> install  SOAP::Lite
#!perl -w
use SOAP::Lite;
print SOAP::Lite
    
-> proxy('http://127.0.0.1:8080/axis/HelloWorld.jws')
    
-> uri('http://127.0.0.1:8080/axis/HelloWorld.jws')
    
-> sayHello()
    
-> result;
结果: HELLO soap!






整理 www.blogjava.net/Good-Game
posted on 2009-03-02 00:00 刘凯毅 阅读(1431) 评论(0)  编辑  收藏 所属分类: perl集群开发

只有注册用户登录后才能发表评论。


网站导航: