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

(-)src/protocol/http/org/apache/jmeter/protocol/http/control/gui/WebServiceSamplerGui.java (-10 / +14 lines)
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());
267
            fillWsdlMethods(wsdlField.getText(), true);
268
        }
268
        }
269
        protocol.setText(sampler.getProtocol());
269
        protocol.setText(sampler.getProtocol());
270
        domain.setText(sampler.getDomain());
270
        domain.setText(sampler.getDomain());
Lines 318-326 Link Here
318
     * easily replace it with a different WSDL driver later on.
318
     * easily replace it with a different WSDL driver later on.
319
     *
319
     *
320
     * @param url
320
     * @param url
321
     * @param silent 
321
     * @return array of web methods
322
     * @return array of web methods
322
     */
323
     */
323
    public String[] browseWSDL(String url) {
324
    public String[] browseWSDL(String url, boolean silent) {
324
        try {
325
        try {
325
            // We get the AuthManager and pass it to the WSDLHelper
326
            // We get the AuthManager and pass it to the WSDLHelper
326
            // once the sampler is updated to Axis, all of this stuff
327
            // once the sampler is updated to Axis, all of this stuff
Lines 332-342 Link Here
332
            HELPER.parse();
333
            HELPER.parse();
333
            return HELPER.getWebMethods();
334
            return HELPER.getWebMethods();
334
        } catch (Exception exception) {
335
        } catch (Exception exception) {
335
            JOptionPane.showConfirmDialog(this,
336
            if(!silent)
336
                    JMeterUtils.getResString("wsdl_helper_error") // $NON-NLS-1$
337
            {
337
                    +"\n"+exception, // $NON-NLS-1$
338
                JOptionPane.showConfirmDialog(this,
338
                    "Warning",
339
                        JMeterUtils.getResString("wsdl_helper_error") // $NON-NLS-1$
339
                    JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
340
                        +"\n"+exception, // $NON-NLS-1$
341
                        "Warning",
342
                        JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
343
            }
340
            return ArrayUtils.EMPTY_STRING_ARRAY;
344
            return ArrayUtils.EMPTY_STRING_ARRAY;
341
        }
345
        }
342
    }
346
    }
Lines 365-371 Link Here
365
        } else if (eventSource == wsdlButton){
369
        } else if (eventSource == wsdlButton){
366
            final String wsdlText = wsdlField.getText();
370
            final String wsdlText = wsdlField.getText();
367
            if (wsdlText != null && wsdlText.length() > 0) {
371
            if (wsdlText != null && wsdlText.length() > 0) {
368
                fillWsdlMethods(wsdlText);
372
                fillWsdlMethods(wsdlText, false);
369
            } else {
373
            } else {
370
                JOptionPane.showConfirmDialog(this,
374
                JOptionPane.showConfirmDialog(this,
371
                        JMeterUtils.getResString("wsdl_url_error"), // $NON-NLS-1$
375
                        JMeterUtils.getResString("wsdl_url_error"), // $NON-NLS-1$
Lines 378-385 Link Here
378
    /**
382
    /**
379
     * @param wsdlText
383
     * @param wsdlText
380
     */
384
     */
381
    private void fillWsdlMethods(final String wsdlText) {
385
    private void fillWsdlMethods(final String wsdlText, boolean silent) {
382
        String[] wsdlData = browseWSDL(wsdlText);
386
        String[] wsdlData = browseWSDL(wsdlText, silent);
383
        if (wsdlData != null) {
387
        if (wsdlData != null) {
384
            wsdlMethods.setValues(wsdlData);
388
            wsdlMethods.setValues(wsdlData);
385
            wsdlMethods.repaint();
389
            wsdlMethods.repaint();
(-)src/protocol/http/org/apache/jmeter/protocol/http/util/WSDLHelper.java (+3 lines)
Lines 180-185 Link Here
180
            if (CONN instanceof HttpURLConnection && this.AUTH != null && this.AUTH.getAuthHeaderForURL(this.WSDLURL) != null) {
180
            if (CONN instanceof HttpURLConnection && this.AUTH != null && this.AUTH.getAuthHeaderForURL(this.WSDLURL) != null) {
181
                CONN.setRequestProperty("Authorization", this.AUTH.getAuthHeaderForURL(this.WSDLURL));
181
                CONN.setRequestProperty("Authorization", this.AUTH.getAuthHeaderForURL(this.WSDLURL));
182
            }
182
            }
183
            // TODO Maybe create a property for this
184
            CONN.setConnectTimeout(5000);
185
            CONN.setReadTimeout(5000);
183
        } catch (IOException exception) {
186
        } catch (IOException exception) {
184
            throw exception;
187
            throw exception;
185
        }
188
        }

Return to bug 51830