HTTPconnection error EndRequest

Hi fellow community.

When I run the following code from a CRMScript, I get this error:

"HTTPConnection::endRequest(): Couldn't resolve host name"

Do anyone of you have an idea, on why this problems occurs? 

 

#setLanguageLevel 3;

//String restUrl = "http://jfmcrossintmob.jf.medier:8081/caijfmdev/api/750/v1/";
String restUrl = "http://jfmcrossintmob.jf.medier:8080/caijfmdb/api/750/v1/";
String url = restUrl+"customers/search";

HTTP h;
h.setOption("username", "concare");
h.setOption("password", "concare");
h.setValue("cuCuzip", "8000");
h.addHeader("Content-Type" ,"application/json");

String htmlSvar = String(h.post(url.urlEncode()));
//Byte[] b = h.post(test.urlEncode());
print(h.getErrorMessage());

RE: HTTPconnection error EndRequest

Hi, from Online you cannot connect to port 8080. Only port 80 and 443 is open.

Av: Frode Lillerud 25. jul 2018

RE: HTTPconnection error EndRequest

Hi Frode.

So there is restrictions on which ports in the other end I can call?

Is this the same for on-premise solutions as well?

 

Thank you for this clarification :)

Av: Kasper Rosenlund 25. jul 2018

RE: HTTPconnection error EndRequest

Hi Kasper,

There aren't any port restriction on on-site (atleast not done by CS), Are you sure that the server which runs Customer Service can resolve the hostname "jfmcrossintmob.jf.medier" to an ip address? try pinging it on the server to troubleshoot.

Av: David Hollegien 25. jul 2018

RE: HTTPconnection error EndRequest

Hi David.

It can ping it without any problems, with a resulting ip. I can even access the website from the browser directly.

Av: Kasper Rosenlund 25. jul 2018

RE: HTTPconnection error EndRequest

Yes, in Online there are restrictions as to which ports you can connect to with the HTTP class.

OnSite does not have any restrictions.

Av: Frode Lillerud 25. jul 2018