² 不使用客户桩调用一个web服务:
为了实现不使用客户桩调用web服务的功能,我们需要首先在src中新建一个com.ttdev.ss.lowlevel包,在这个包中新建一个LowLevelClient.java文件,文件的编写如下所示:
运行,结果如下所示:
出错!!!错误描述为:“The endpoint reference (EPR) for the Operation not found is 127.0.0.1/axis2/services/SimpleService and the WSA Action = urn:anonOutInOp:”没有办法找到我们要调用的服务的方法。
需要加上:options.setAction("http://ttdev.com/ss/concat");
如下图所示:
setAction()相当于告诉Web Service要调用的是哪个方法。setAction的参数字符串构成为:targetNamespace对应的URI + operation,这两者在WSDL中都有描述,如下图所示: