微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Get the parameter of webservice xml

{//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;             } }

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐