Package org.vnetcon.xml.ws.servlet.dao

Examples of org.vnetcon.xml.ws.servlet.dao.SoapMethodCall


  public String execute() throws Exception {
    String strRet = null;
    Envelope env = this.xmlToEnvelope(this.soapRequest);
    Body body = env.getBody();
    String bodyXml = this.bodyToXML(body);
    SoapMethodCall smc = this.parseSoapBody(bodyXml);
    String methodRequest = smc.getMethodName();
    WebMethod webMethod = this.hashWebMethods.get(methodRequest);
    strRet = this.doNativeMethodCall(webMethod, smc);
    env = null;
    smc = null;
    Runtime.getRuntime().gc();
View Full Code Here


   * @param xml
   * @return
   * @throws Exception
   */
  private SoapMethodCall parseSoapBody(String xml) throws Exception {
    SoapMethodCall smc = null;
    String lines[] = xml.split("\n");
    boolean inBody = false;
    int i = 0;
    int iArgCounter = 0;
    while(i < lines.length){
      String line = lines[i].trim();
     
      if(line.toLowerCase().indexOf("body ") > -1){
        i++;
        line = lines[i].trim();
        smc = new SoapMethodCall(this.getSoapMethodName(line));
        inBody = true;
        continue;
      }
     
      if(line.toLowerCase().indexOf("body>") > -1){
        inBody = false;
      }

      if(inBody){
        if(line.toLowerCase().indexOf("arg" + iArgCounter + "_") > -1){
          String argName = this.getSoapArgumentName(line);
          String argXml = "";
         
          // empty argument including ending slash in tag
          if(argName.endsWith("/")){
            argName = argName.substring(0, argName.length() - 1).trim();
            smc.addParameterXml(argName, argXml);
            i++;
            continue;
          }
         
          // starting and ending tags both in same line
          if(line.substring(line.indexOf(argName) + argName.length()).indexOf(argName) > -1){
            argXml = this.getOneLineValue(line);
            smc.addParameterXml(argName, argXml);
            i++;
            continue;
          }
         
          i++;
          while(lines[i].indexOf(argName) == -1){
            argXml += lines[i].trim();
            i++;
          }
         
          smc.addParameterXml(argName, argXml);
          iArgCounter++;
        }
      }
     
      i++;
View Full Code Here

TOP

Related Classes of org.vnetcon.xml.ws.servlet.dao.SoapMethodCall

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.