WebService请求wsdl外部接口

JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();

Client client = dcf.createClient(url);

Object[] objects =new Object[0];

//请求返回值

objects = client.invoke("请求地址", "请求参数");

//将获取的XML数组转换为String

String XMLString = objects[0].toString();

//将String字符串解析为XML格式

Document document = DocumentHelper.parseText(XMLString);

Element root = document.getRootElement();

//获取需要解析的数据XML结点属性

String PBCDate = root.elementText("XML标签结点名称");

你可能感兴趣的:(WebService请求wsdl外部接口)