Get the parameter of webservice xml
发布时间:2020-12-17 02:38:18 所属栏目:安全 来源:网络整理
导读:{//test1模块处理 ?? ??? ??? ?Pattern pattern = Pattern.compile("test1.*?xmlns=.*?.*?/test1");??????? ? ?? ??? ??? ?Matcher matcher = pattern.matcher(xmlDataFromServer); ?? ??? ??? ?if(matcher.find()) { ?? ??? ??? ??? ?//System.out.println(
{//test1模块处理 ?? ??? ??? ?Pattern pattern = Pattern.compile("<test1.*?xmlns=.*?>.*?</test1>");??????? ? ?? ??? ??? ?Matcher matcher = pattern.matcher(xmlDataFromServer); ?? ??? ??? ?if(matcher.find()) { ?? ??? ??? ??? ?//System.out.println("matcher="+matcher.group()); ?? ??? ??? ??? ?String paraall = matcher.group(); ?? ??? ??? ??? ?//test过程,返回参数 ?? ??? ??? ??? ?pattern = Pattern.compile("<s>.*?</s>"); ?? ??? ??? ??? ?matcher = pattern.matcher(paraall); ?? ??? ??? ??? ?String myval=""; ?? ??? ??? ??? ?if(matcher.find()) { ?? ??? ??? ??? ??? ?System.out.println("s="+matcher.group()); ?? ??? ??? ??? ??? ?myval = matcher.group(); ?? ??? ??? ??? ??? ?int npos1=myval.indexOf(">"); ?? ??? ??? ??? ??? ?int npos2=myval.indexOf("</s>"); ?? ??? ??? ??? ??? ?if(npos1>0&&npos2>0) ?? ??? ??? ??? ??? ?{ ?? ??? ??? ??? ??? ??? ?myval=myval.substring(npos1+1,npos2); ?? ??? ??? ??? ??? ??? ?System.out.println("sreal="+myval); ?? ??? ??? ??? ??? ?} ?? ??? ??? ??? ??? ? ?? ??? ??? ??? ?} ?? ??? ? String ret = "??? <soap:Envelope/r/n" ?? ??? ??? ??? ?+"??????? xmlns:soap=/"http://schemas.xmlsoap.org/soap/envelope//"/r/n" ?? ??? ??? ??? ?+"??????? xmlns:xsd=/"http://www.w3.org/2001/XMLSchema/"/r/n" ?? ??? ??? ??? ?+"??????? xmlns:xsi=/"http://www.w3.org/2001/XMLSchema-instance/">/r/n" ?? ??? ??? ??? ?+"??????? <soap:Body>/r/n" ?? ??? ??? ??? ?+"??????????? <ns1:orderhadleResponse/r/n" ?? ??? ??? ??? ?+"??????????????? xmlns:ns1=/"http://www.118114ok.com//">/r/n" ?? ??? ??? ??? ?+"??????????????? <ns1:out>"+myval+"</ns1:out>/r/n" ?? ??? ??? ??? ?+"??????????????? </ns1:orderhadleResponse>/r/n" ?? ??? ??? ??? ?+"??????????? </soap:Body>/r/n" ?? ??? ??? ??? ?+"??????? </soap:Envelope>/r/n"; ?? ??? ??? ??? ?out.println(ret); ?? ??? ??? ??? ?return; ?? ??? ??? ?} }
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |