我假设您只对Web服务客户端感兴趣?
选项1
使用Axis2 REST支持来调用Web服务,例如:
http:// localhost:8080 / axis2 / services / MyService / myOperation?param1 =
one&param2 =
two
选项2
使用SOAPUI。通过阅读服务的WSDL,它可以为您生成SOAP消息。我的客户的测试人员仅在对Web服务技术有非常广泛的了解的情况下广泛使用它。令人印象深刻的工具。
选项3
Groovy客户端(与其他基于JVM的语言相同的方法)
使用 wsdl2java 工具为莎士比亚Web服务创建客户机存根类:
generate.sh :
$AXIS2_HOME/bin/wsdl2java.sh -d adb -s -o build -uri http://www.xmlme.com/WSShakespeare.asmx?WSDLant -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 payloaddef request = new ShakespeareStub.GetSpeech()request.setRequest("Friends, romans, countrymen")// Send requestresponse = stub.getSpeech(request)println response.getGetSpeechResult()使用-cp参数将生成的代码添加到脚本的类路径中
groovy -cp build/build/classes GetSpeech



