public String sayHello(){
return "Hello world!";
}
////////////////////////////此方法调用webservice的方法,返回值/////////////////////////////////////
public String getString()
{
String ret = null;
try
{
String endpoint =
"http://localhost:8080/LSA/services/test";
Service service = new Service();
Call call = null;
call = (Call) service.createCall();
call.setOperationName(new QName(
"http://localhost:8080/LSA/services/test",
"sayHello"));
call.setTargetEndpointAddress(new java.net.URL(endpoint));
ret=(String)call.invoke(new Object[]{});
}catch(Exception e)
{
e.printStackTrace();
}
return ret;
}
/////////////////////////////////////END//////////////////////////////////////////////
联系客服