sebb        2005/05/19 16:26:15

  Modified:    src/protocol/http/org/apache/jmeter/protocol/http/sampler
                        WebServiceSampler.java
  Log:
  Set Sample label from Test Element name
  Fix some NPEs when sampler data is incomplete
  
  Revision  Changes    Path
  1.25      +9 -6      
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java
  
  Index: WebServiceSampler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- WebServiceSampler.java    15 May 2005 14:59:08 -0000      1.24
  +++ WebServiceSampler.java    19 May 2005 23:26:15 -0000      1.25
  @@ -379,7 +379,9 @@
           }
           else
           {
  -            return openDocument(null).getDocumentElement();
  +             Document doc = openDocument(null);
  +             if (doc == null) return null;
  +            return doc.getDocumentElement();
           }
       }
   
  @@ -448,12 +450,13 @@
                SampleResult RESULT = new SampleResult();
           try
           {
  +            RESULT.setURL(this.getUrl());
  +            RESULT.setSampleLabel(getName());
                        org.w3c.dom.Element rdoc = createDocument();
  +                     if (rdoc == null) throw new SOAPException("Could not 
create document",null);
               Envelope msgEnv = Envelope.unmarshall(rdoc);
               // create a new message
               Message msg = new Message();
  -            RESULT.setURL(this.getUrl());
  -            RESULT.setSampleLabel(this.getUrl().toString());
               RESULT.sampleStart();
                        SOAPHTTPConnection spconn = null;
                        // if a blank HeaderManager exists, try to
  @@ -574,7 +577,7 @@
               // response code
           }
           catch (SOAPException exception){
  -            log.debug(exception.getMessage());
  +            log.warn(exception.getMessage());
               RESULT.setSuccessful(false);
           }
           catch (MalformedURLException exception){
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to