Connection refused exception in all HTTP requests

2019-09-06 16:11发布

问题:

I have a very plain jmeter project. I just send an HTTP GET request to my webservice wsdl file to verify if everything is working fine. However both the myinternal.server.local/ws/calc webservice request and HTTP GET to myinternal.server.local/ws/calc?wsdl fail with following exceptions;

Non HTTP response code: org.apache.http.conn.HttpHostConnectException
Non HTTP response message: Connection to https://myinternal.server.local

I am sure that webservice works because I can invoke it with via SOAP UI and IE displays the wsdl when https://myinternal.server.local/ws/calc?wsdl is called.

HTTP Request returns

    org.apache.http.conn.HttpHostConnectException: Connection to https://myinternal.server.local refused
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:645)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:480)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:286)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1088)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1077)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:428)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.net.ConnectException: connect: Connection timed out

When SOAP/XML-RPC Request is selected then it returns

Caused by: java.net.ConnectException: connect: Connection timed out

I am on JDK 1.8.0_20 (64-bit) with jmeter 2.11 @64 bit Windows-7

Can you think of what the root cause can be?

Regards,

回答1:

Follow the below steps:

  1. Use the "templates"
  2. select "Building a SOAP WebService Test Plan" & click on "Create" button.
  3. then edit the values to point to your own wsdl, and fix up the request xml as required.

For https you will probably need to specify port 443 in the HTTP Request defaults, but I have found the SOAP/RPC sampler handles https without using the default element.
Just specify the entire URL in the sampler. You can include the port in the URL if it is non-default for the protocol.



回答2:

Without even looking at the specifics of your issue, I'd try again with Java 6 or 7. I've had tests which ran fine with JDK 1.7 but failed with 1.8.