You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by wo...@apache.org on 2005/05/14 03:33:08 UTC

cvs commit: jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/util WSDLHelper.java

woolfel     2005/05/13 18:33:08

  Modified:    src/protocol/http/org/apache/jmeter/protocol/http/util
                        WSDLHelper.java
  Log:
  updated the WSDLHelper to work with gSoap generated WSDL. gSoap generates wsdl in
  an odd format unlike other webservice toolkits.
  
  peter
  
  Revision  Changes    Path
  1.9       +24 -4     jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/util/WSDLHelper.java
  
  Index: WSDLHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/util/WSDLHelper.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- WSDLHelper.java	7 Nov 2004 02:07:42 -0000	1.8
  +++ WSDLHelper.java	14 May 2005 01:33:08 -0000	1.9
  @@ -132,6 +132,10 @@
   						servlist =
   						pnode.getElementsByTagName("wsdlsoap:address");
                       }
  +                    if (servlist.getLength() == 0){
  +                        servlist =
  +                        pnode.getElementsByTagName("SOAP:address");
  +                    }
                       Element addr = (Element) servlist.item(0);
                       this.SOAPBINDING = addr.getAttribute("location");
                       return this.SOAPBINDING;
  @@ -258,10 +262,19 @@
   				opers =
   					((Element) act).getElementsByTagName("wsdl:operation");
   			}
  +            if (opers.getLength() == 0){
  +                opers =
  +                    ((Element) act).getElementsByTagName("operation");
  +            }
               
               // there should only be one soap:operation node per operation
               Element op = (Element) opers.item(0);
  -            String value = op.getAttribute("soapAction");
  +            String value;
  +            if (op != null){
  +                value = op.getAttribute("soapAction");
  +            } else {
  +                value = "";
  +            }
               String key = ((Element) act).getAttribute("name");
               this.ACTIONS.put(key, value);
           }
  @@ -304,6 +317,10 @@
           if (WSDLDOC.getElementsByTagName(soapBind).getLength() == 0){
   			soapBind = "wsdlsoap:binding";
           }
  +        if (WSDLDOC.getElementsByTagName(soapBind).getLength() == 0){
  +            soapBind = "SOAP:binding";
  +        }
  +
           for (int idx = 0; idx < bindings.getLength(); idx++)
           {
               Element nd = (Element) bindings.item(idx);
  @@ -368,6 +385,8 @@
                   if (soapnode.getLength() > 0)
                   {
                       ops.add(child);
  +                } else {
  +                    ops.add(child);
                   }
               }
           }
  @@ -386,7 +405,8 @@
   			WSDLHelper help =
   			// 	new WSDLHelper("http://localhost/WSTest/WSTest.asmx?WSDL");
   			//	new WSDLHelper("http://localhost/AxisWSDL.xml");
  -				new WSDLHelper("http://localhost/test-setup.xml");
  +			//	new WSDLHelper("http://localhost/test-setup.xml");
  +            new WSDLHelper("http://localhost:8080/gsoap.wsdl");
               long start = System.currentTimeMillis();
               help.parse();
               String[] methods = help.getWebMethods();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org