views:

133

answers:

2

So I'm not a very good network person so I was hoping someone could point me in the right direction to figuring out what I am doing wrong.

I am trying to use curl to post a SOAP message. I am running the following:

curl -d "string of xml message" -H "Content-Type:text/xml; charset=utf-8" "[ip]:[port]/[service]"

This results in a 'Connection refused' message.

So I try pinging ip by itself...no problems. Then I think maybe I need http://[ip]:[port]/[service] so I tried pinging http://[ip] and I get: unknown host http://[ip] yet if I ping the IP by itself I get no issues.

Any thoughts on where to start debugging this issue?

A: 

Ping (or ICMP) traffic runs (usually) on a different port than HTTP traffic. HTTP typically runs on port 80.

Try to telnet to the service (the ip and the port) using the following command:

telnet (ip) 80 (without the parens).

If you are able to connect to the service then you have some other issues, however, if the service doesn't let you connect, then you know the service is blocking you from the port (usually 80 for http) on which the service is running.

El Guapo
Telnet nmap work equally well.
amphetamachine
I received connection refused on the telnet command...what does this mean?
bmucklow
It means the host isn't accepting connections on that port. It is not configured the way you expect.
Matthew Flaschen
@Matthew. I am the one trying to set up the server with the service on my personal PC (laptop) and I am trying to access it from another computer.
bmucklow
A: 

First of all, ping can't use the HTTP-protocol, you can only ping domain names. Have a look at ping at wikipedia to learn more.

Curl normally doesn't need anything fancy, just begin by typing curl [protocol]:[host]:[port]/[service] and see if you get a response at all. I think that's what you're looking for when you tried to ping the remote address.

Judging by the response of the cURL attempt, you'll know if your attempt was successfull. It probably won't be since it is indeed the connection that was refused, you didn't include bad parameters.

Now, assuming it's a connection problem, try curling something else (a regular domain, like Google.com) to make sure you don't have a connection problem. Then, to learn whether the remote server has a problem, perform the same Curl attempt from another server somewhere (or ask someone else to do it) and see if they, too, are refused to connect. This is a good attempt to circle in around the problem and gain more clarity.

Jonatan Littke
This simple curl fails. Also I can't ping http://www.google.com, from either my PC or the PC I am trying to run the curl command on.
bmucklow
Start -> Run -> Cmd -> Ping 'www.google.com'. Doesn't work? Also, when you're curling, do provide a protocol (e.g `curl http://localhost:8010/service/). I've updated my response to reflect that. From the machine you're trying to set up the server on, you may want to curl to localhost on the correct port to see if the web server is set up correctly.
Jonatan Littke