View | Details | Raw Unified | Return to bug 51605
Collapse All | Expand All

(-)src/protocol/http/org/apache/jmeter/protocol/http/control/gui/WebServiceSamplerGui.java (-4 / +13 lines)
Lines 68-74 Link Here
68
68
69
    private final JLabeledTextArea soapXml = new JLabeledTextArea(JMeterUtils.getResString("soap_data_title")); // $NON-NLS-1$
69
    private final JLabeledTextArea soapXml = new JLabeledTextArea(JMeterUtils.getResString("soap_data_title")); // $NON-NLS-1$
70
70
71
    private final JLabeledTextField wsdlField = new JLabeledTextField(JMeterUtils.getResString("wsdl_url")); // $NON-NLS-1$
71
    private final JLabeledTextField wsdlField = new JLabeledTextField(JMeterUtils.getResString("wsdl_url"), 30); // $NON-NLS-1$
72
72
73
    private final JButton wsdlButton = new JButton(JMeterUtils.getResString("load_wsdl")); // $NON-NLS-1$
73
    private final JButton wsdlButton = new JButton(JMeterUtils.getResString("load_wsdl")); // $NON-NLS-1$
74
74
Lines 264-270 Link Here
264
        wsdlField.setText(sampler.getWsdlURL());
264
        wsdlField.setText(sampler.getWsdlURL());
265
        final String wsdlText = wsdlField.getText();
265
        final String wsdlText = wsdlField.getText();
266
        if (wsdlText != null && wsdlText.length() > 0) {
266
        if (wsdlText != null && wsdlText.length() > 0) {
267
            fillWsdlMethods(wsdlField.getText(), true);
267
            fillWsdlMethods(wsdlField.getText(), true, sampler.getSoapAction());
268
        }
268
        }
269
        protocol.setText(sampler.getProtocol());
269
        protocol.setText(sampler.getProtocol());
270
        domain.setText(sampler.getDomain());
270
        domain.setText(sampler.getDomain());
Lines 368-374 Link Here
368
        } else if (eventSource == wsdlButton){
368
        } else if (eventSource == wsdlButton){
369
            final String wsdlText = wsdlField.getText();
369
            final String wsdlText = wsdlField.getText();
370
            if (wsdlText != null && wsdlText.length() > 0) {
370
            if (wsdlText != null && wsdlText.length() > 0) {
371
                fillWsdlMethods(wsdlText, false);
371
                fillWsdlMethods(wsdlText, false, null);
372
            } else {
372
            } else {
373
                JOptionPane.showConfirmDialog(this,
373
                JOptionPane.showConfirmDialog(this,
374
                        JMeterUtils.getResString("wsdl_url_error"), // $NON-NLS-1$
374
                        JMeterUtils.getResString("wsdl_url_error"), // $NON-NLS-1$
Lines 380-390 Link Here
380
380
381
    /**
381
    /**
382
     * @param wsdlText
382
     * @param wsdlText
383
     * @param silent
384
     * @param soapAction 
383
     */
385
     */
384
    private void fillWsdlMethods(final String wsdlText, boolean silent) {
386
    private void fillWsdlMethods(final String wsdlText,  boolean silent, String soapAction) {
385
        String[] wsdlData = browseWSDL(wsdlText, silent);
387
        String[] wsdlData = browseWSDL(wsdlText, silent);
386
        if (wsdlData != null) {
388
        if (wsdlData != null) {
387
            wsdlMethods.setValues(wsdlData);
389
            wsdlMethods.setValues(wsdlData);
390
            if (HELPER != null && soapAction != null) {
391
                String selected = HELPER.getSoapActionName(soapAction);
392
                if (selected != null) {
393
                    wsdlMethods.setText(selected);
394
                }
395
            }
396
388
            wsdlMethods.repaint();
397
            wsdlMethods.repaint();
389
        }
398
        }
390
    }
399
    }
(-)src/protocol/http/org/apache/jmeter/protocol/http/util/WSDLHelper.java (+15 lines)
Lines 376-381 Link Here
376
    }
376
    }
377
377
378
    /**
378
    /**
379
     * return the "wsdl method name" from a soap action
380
     * @param soapAction the soap action
381
     * @return the associated "wsdl method name" or null if not found
382
     */
383
    public String getSoapActionName(String soapAction) {
384
        for (Map.Entry<String, String> entry : ACTIONS.entrySet()) {
385
            if (entry.getValue().equals(soapAction)) {
386
                return entry.getKey();
387
            }
388
        }
389
        return null;
390
    }
391
    
392
    /**
379
     * Simple test for the class uses bidbuy.wsdl from Apache's soap driver
393
     * Simple test for the class uses bidbuy.wsdl from Apache's soap driver
380
     * examples.
394
     * examples.
381
     *
395
     *
Lines 403-406 Link Here
403
            exception.printStackTrace();
417
            exception.printStackTrace();
404
        }
418
        }
405
    }
419
    }
420
406
}
421
}

Return to bug 51605