我假设您只对网络服务客户端感兴趣?
Option 1
使用 Axis2 调用 Web 服务休息支持 http://ws.apache.org/axis2/1_5_1/rest-ws.html, 例如:
Option 2
Use SOAPUI http://www.soapui.org/。它可以通过读取服务的 WSDL 为您生成 SOAP 消息。我客户的测试人员一直在广泛使用它,但对 Web 服务技术只有非常广泛的了解。一个令人印象深刻的工具。
Option 3
Groovy 客户端(对于其他基于 JVM 的语言也采用相同的方法)
Use the wsdl2java为 Shakespeare Web 服务创建客户端存根类的工具:
生成.sh:
$AXIS2_HOME/bin/wsdl2java.sh -d adb -s -o build -uri http://www.xmlme.com/WSShakespeare.asmx?WSDL
ant -file build/build.xml
GetSpeech.groovy:
// Dependencies
// ============
import com.xmlme.webservices.ShakespeareStub
@Grapes([
@Grab(group='org.apache.axis2', module='axis2-kernel', version='1.5.1'),
@Grab(group='org.apache.axis2', module='axis2-adb', version='1.5.1'),
@Grab(group='org.apache.axis2', module='axis2-transport-local', version='1.5.1'),
@Grab(group='org.apache.axis2', module='axis2-transport-http', version='1.5.1'),
@Grab(group='xerces', module='xercesImpl', version='2.6.2'),
@GrabConfig(systemClassLoader=true)
])
// Main program
// ============
def stub = new ShakespeareStub()
// Request payload
def request = new ShakespeareStub.GetSpeech()
request.setRequest("Friends, romans, countrymen")
// Send request
response = stub.getSpeech(request)
println response.getGetSpeechResult()
使用 -cp 参数将生成的代码添加到脚本的类路径中
groovy -cp build/build/classes GetSpeech