读书人

CXF客户端动态调用webservice有关问题

发布时间: 2013-12-15 22:17:18 作者: rapoo

CXF客户端动态调用webservice问题
public class WSClient {
public static void main(String[] args)throws Exception {
String wsdlUrl = "http://www.webxml.com.cn/webservices/chinatvprogramwebservice.asmx?wsdl";
JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();
Client client = factory.createClient(wsdlUrl);

Object[] res = client.invoke("getAreaString");
System.out.println(res[0]);
}
}

上面是我测试代码,电视台提供了Web Services,本地不希望保存WSDL,上面代码运行报错,求指导。
[解决办法]
http://blog.csdn.net/chenghui0317/article/details/9320053
试试这个。。

读书人网 >J2EE开发

热点推荐