Package org.apache.jmeter.protocol.http.sampler

Examples of org.apache.jmeter.protocol.http.sampler.WebServiceSampler


        try {
            // We get the AuthManager and pass it to the WSDLHelper
            // once the sampler is updated to Axis, all of this stuff
            // should not be necessary. Now I just need to find the
            // time and motivation to do it.
            WebServiceSampler sampler = (WebServiceSampler) this.createTestElement();
            AuthManager manager = sampler.getAuthManager();
            HELPER = new WSDLHelper(url, manager);
            HELPER.parse();
            return HELPER.getWebMethods();
        } catch (Exception exception) {
            JOptionPane.showConfirmDialog(this,
View Full Code Here


  /**
   * @see JMeterGUIComponent#createTestElement()
   */
  public TestElement createTestElement() {
    WebServiceSampler sampler = new WebServiceSampler();
    this.configureTestElement(sampler);
    try {
      URL url = new URL(urlField.getText());
      sampler.setDomain(url.getHost());
      if (url.getPort() != -1){
        sampler.setPort(url.getPort());
      } else {
        sampler.setPort(80);
      }
      sampler.setProtocol(url.getProtocol());
      sampler.setMethod(WebServiceSampler.POST);
      sampler.setPath(url.getPath());
      sampler.setSoapAction(soapAction.getText());
      sampler.setXmlData(soapXml.getText());
      sampler.setXmlFile(soapXmlFile.getFilename());
      sampler.setXmlPathLoc(randomXmlFile.getText());
      sampler.setMemoryCache(memCache.isSelected());
      sampler.setReadResponse(readResponse.isSelected());
    } catch(MalformedURLException e) {
    }
    return sampler;
  }
View Full Code Here

   * Modifies a given TestElement to mirror the data in the gui components.
   * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
   */
  public void modifyTestElement(TestElement s)
  {
    WebServiceSampler sampler = (WebServiceSampler)s;
    this.configureTestElement(sampler);
    try {
      URL url = new URL(urlField.getText());
      sampler.setDomain(url.getHost());
      if (url.getPort() != -1){
        sampler.setPort(url.getPort());
      } else {
        sampler.setPort(80);
      }
      sampler.setProtocol(url.getProtocol());
      sampler.setMethod(WebServiceSampler.POST);
      sampler.setPath(url.getPath());
      sampler.setSoapAction(soapAction.getText());
      sampler.setXmlData(soapXml.getText());
      sampler.setXmlFile(soapXmlFile.getFilename());
      sampler.setXmlPathLoc(randomXmlFile.getText());
      sampler.setMemoryCache(memCache.isSelected());
      sampler.setReadResponse(readResponse.isSelected());
    } catch(MalformedURLException e) {
    }
  }
View Full Code Here

   * action for the request.
   */
  public void configure(TestElement el)
  {
    super.configure(el);
    WebServiceSampler sampler = (WebServiceSampler)el;
    try {
      // only set the URL if the host is not null
      if (sampler.getUrl() != null && sampler.getUrl().getHost() != null){
        urlField.setText(sampler.getUrl().toString());
      }
      soapAction.setText(sampler.getSoapAction());
    } catch(MalformedURLException e) {
    }
    // we build the string URL
    int port = sampler.getPort();
    String strUrl = sampler.getProtocol() + "://" + sampler.getDomain();
    if (port != -1 && port != 80){
      strUrl += ":" + sampler.getPort();
    }
    strUrl += sampler.getPath() + "?" + sampler.getQueryString();
    urlField.setText(strUrl);
    soapXml.setText(sampler.getXmlData());
    soapXmlFile.setFilename(sampler.getXmlFile());
    randomXmlFile.setText(sampler.getXmlPathLoc());
    memCache.setSelected(sampler.getMemoryCache());
    readResponse.setSelected(sampler.getReadResponse());
  }
View Full Code Here

    /**
     * @see org.apache.jmeter.gui.JMeterGUIComponent#createTestElement()
     */
    public TestElement createTestElement() {
        WebServiceSampler sampler = new WebServiceSampler();
        this.configureTestElement(sampler);
        this.modifyTestElement(sampler);
        return sampler;
    }
View Full Code Here

     * Modifies a given TestElement to mirror the data in the gui components.
     *
     * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
     */
    public void modifyTestElement(TestElement s) {
        WebServiceSampler sampler = (WebServiceSampler) s;
        this.configureTestElement(sampler);
        sampler.setDomain(domain.getText());
        sampler.setProperty(HTTPSamplerBase.PORT,port.getText());
        sampler.setProtocol(protocol.getText());
        sampler.setPath(path.getText());
        sampler.setWsdlURL(wsdlField.getText());
        sampler.setMethod(HTTPSamplerBase.POST);
        sampler.setSoapAction(soapAction.getText());
        sampler.setXmlData(soapXml.getText());
        sampler.setXmlFile(soapXmlFile.getFilename());
        sampler.setXmlPathLoc(randomXmlFile.getText());
        sampler.setTimeout(connectTimeout.getText());
        sampler.setMemoryCache(memCache.isSelected());
        sampler.setReadResponse(readResponse.isSelected());
        sampler.setUseProxy(useProxy.isSelected());
        sampler.setProxyHost(proxyHost.getText());
        sampler.setProxyPort(proxyPort.getText());
    }
View Full Code Here

     * the implementation loads the URL and the soap action for the request.
     */
    @Override
    public void configure(TestElement el) {
        super.configure(el);
        WebServiceSampler sampler = (WebServiceSampler) el;
        wsdlField.setText(sampler.getWsdlURL());
        protocol.setText(sampler.getProtocol());
        domain.setText(sampler.getDomain());
        port.setText(sampler.getPropertyAsString(HTTPSamplerBase.PORT));
        path.setText(sampler.getPath());
        soapAction.setText(sampler.getSoapAction());
        soapXml.setText(sampler.getXmlData());
        soapXmlFile.setFilename(sampler.getXmlFile());
        randomXmlFile.setText(sampler.getXmlPathLoc());
        connectTimeout.setText(sampler.getTimeout());
        memCache.setSelected(sampler.getMemoryCache());
        readResponse.setSelected(sampler.getReadResponse());
        useProxy.setSelected(sampler.getUseProxy());
        if (sampler.getProxyHost().length() == 0) {
            proxyHost.setEnabled(false);
        } else {
            proxyHost.setText(sampler.getProxyHost());
        }
        if (sampler.getProxyPort() == 0) {
            proxyPort.setEnabled(false);
        } else {
            proxyPort.setText(String.valueOf(sampler.getProxyPort()));
        }
    }
View Full Code Here

        try {
            // We get the AuthManager and pass it to the WSDLHelper
            // once the sampler is updated to Axis, all of this stuff
            // should not be necessary. Now I just need to find the
            // time and motivation to do it.
            WebServiceSampler sampler = (WebServiceSampler) this.createTestElement();
            AuthManager manager = sampler.getAuthManager();
            HELPER = new WSDLHelper(url, manager);
            HELPER.parse();
            return HELPER.getWebMethods();
        } catch (Exception exception) {
            JOptionPane.showConfirmDialog(this,
View Full Code Here

  /**
   * @see org.apache.jmeter.gui.JMeterGUIComponent#createTestElement()
   */
  public TestElement createTestElement() {
    WebServiceSampler sampler = new WebServiceSampler();
    this.configureTestElement(sampler);
    this.modifyTestElement(sampler);
    return sampler;
  }
View Full Code Here

   * Modifies a given TestElement to mirror the data in the gui components.
   *
   * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
   */
  public void modifyTestElement(TestElement s) {
    WebServiceSampler sampler = (WebServiceSampler) s;
    this.configureTestElement(sampler);
    sampler.setDomain(domain.getText());
        sampler.setProperty(HTTPSamplerBase.PORT,port.getText());
        sampler.setProtocol(protocol.getText());
    sampler.setPath(path.getText());
    sampler.setWsdlURL(wsdlField.getText());
    sampler.setMethod(HTTPSamplerBase.POST);
    sampler.setSoapAction(soapAction.getText());
    sampler.setXmlData(soapXml.getText());
    sampler.setXmlFile(soapXmlFile.getFilename());
    sampler.setXmlPathLoc(randomXmlFile.getText());
        sampler.setTimeout(connectTimeout.getText());
    sampler.setMemoryCache(memCache.isSelected());
    sampler.setReadResponse(readResponse.isSelected());
    sampler.setUseProxy(useProxy.isSelected());
    sampler.setProxyHost(proxyHost.getText());
    sampler.setProxyPort(proxyPort.getText());
  }
View Full Code Here

TOP

Related Classes of org.apache.jmeter.protocol.http.sampler.WebServiceSampler

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.