I have a HTTP Request Sampler in my test plan. I have given my server name or IP, port and url. I chose the Body Data tab and gave an XML request in this way:
<Request>
<Header><Log><Level>None</Level></Log></Header>
<Body>
<Action>
<GetService>
<Code>ABC</Code>
<CodeValue>XYZ</CodeValue>
</GetService>
</Action>
</Body> </Request>
However, this what I am getting back the following as the Sampler result:
Response code: Non HTTP response code: java.net.ConnectException Response message: Non HTTP response message: Connection refused
Response headers:
HTTPSampleResult fields: ContentType:
DataEncoding: null
I have made sure that I can ping my server. Its up and running.
Is there something else that I am missing here?
Thanks in advance!
You browser uses proxy to connect to the Internet and JMeter doesn't. Try hitting i.e. http://example.com domain with a single JMeter GET request and if it fails - configure JMeter to use the same proxy as browser does via the following command-line parameters:
Server Name
andPort
values and validate them via i.e. telnet command. If telnet is able to connect - JMeter will be able as well as the error states that connection cannot be established.text/xml
orapplication/soap+xml
via HTTP Header ManagerI find it the easiest to just use a SOAP/XML-RPC Request for this kind of stuff. Simply enter the XML you want to send and the URL and make sure that Send SOAPAction is unchecked if you're not using it.
The problem you're having seems to be unrelated though. It looks like JMeter can't get a connection to the server. You should try it manually by using your browser and going to the URL you want to send the XML to. You should at least get a 400 error. "Connection Refused" looks more like the server isn't running.