可能最簡(jiǎn)單的 soap 哦!
服務(wù)器為 java tomcat
下載服務(wù)器:http://www.apache.org/dist/ws/
axis/ 為java
axis-c/ 為 c
1.我這下載的 axis 1_4 版本 ,解壓 /webapps/axis 放到 tomcat 的webapps
啟動(dòng)tomcat(這就不修改任何,如有需要 該 web.xml 等配置了)
參考 >>
blog 主 還有很多介紹 axis 大家可以 看看
日志 > 其下的 "學(xué)習(xí)"
直接寫個(gè)文件
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
結(jié)果 :
<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;
結(jié)果:
HELLO soap!
整理 m.tkk7.com/Good-Game