高手请进:客户端如何测试webservice接口,如何算测试成功
初学webservice,我的环境是tomcat,我用wsdl2java生成相关的类,调用服务器端接口进行测试,接口中有一个方法,notifySmsReception()且没有返回值,我写了个main(),运行没任何错误,但不知道测试成功没有。请高手指点,万分感激。
public class Test {
public static void main(String[] args){
try{
_3GSpgwService service = new _3GSpgwServiceLocator();
String registrationIdentifier="dsfsdfs";
SmsMessage message = new SmsMessage();
message.setMessage("dsfs");
URI uri=new URI("http://212.158.185.170/Ws3GNewUnicom10622999/3GSpgwService.asmx?op=notifySmsReception");
message.setSenderAddress(uri);
message.setSmsServiceActivationNumber(uri);
_3GSpgwServiceSoap_PortType client = service.get_3GSpgwServiceSoap();
client.notifySmsReception(registrationIdentifier, message);
System.out.println(message.getSmsServiceActivationNumber());
System.out.println( service.getHandlerRegistry());
} catch (Exception e){
System.err.println("Execution failed. Exception: " + e);
}
}
}
------解决方案--------------------
将方法加上返回值,客户端调用你的webservice服务,看能否接收到返回值即可