客户端怎么调用一个webservice???????????
调用的这个webservice,传入一个String 型的,要返回一个对象。
可是测试了一下,总是出错。大家看看哪里有问题?
package test;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.soap.rpc.Response;
import javax.xml.rpc.ParameterMode;
public class AXISTest {
public static void main(String[] args) throws Exception {
Service service = new Service();
Call call = (Call) service.createCall();
//////////访问即时发布的Distance服务
//设置访问点
call.setTargetEndpointAddress("http://150.236.80.78:7001/EUPortal/webservice/tcqi.jws");
//设置操作名
call.setOperationName("getDeviceInformation");
//设置入口参数
call.addParameter("deviceName", XMLType.XSD_STRING, ParameterMode.IN);
call.setReturnType(XMLType.XSD_ANYTYPE);
String d1 = "NokiaS60";
GetDeviceInformationOutput resp = (GetDeviceInformationOutput) call.invoke(new Object[] { d1 });
}
}