DOTCMS REST API Question

23 views
Skip to first unread message

Henry Versemann

unread,
Oct 10, 2017, 5:15:30 PM10/10/17
to dot...@googlegroups.com

I’m getting the following exception in response to sending a PowerShell Invoke-WebRequest to our REST API:

 

Failed to get data from DOTCMS

EXCEPTION Response=null

Exception Status=ConnectFailure

RAW EXCEPTION=System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party d

id not properly respond after a period of time, or established connection failed because connected host has failed to respond 52.6.25.245:8082

   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)

   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asy

ncResult, Exception& exception)

   --- End of inner exception stack trace ---

   at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)

   at System.Net.HttpWebRequest.GetRequestStream()

   at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.SetRequestContent(WebRequest request, String content)

   at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()

   at System.Management.Automation.CommandProcessor.ProcessRecord()

INNER EXCEPTION=System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or est

ablished connection failed because connected host has failed to respond 52.6.25.245:8082

   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)

   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asy

ncResult, Exception& exception)

 

The Question is, is the problem on my end or on the DOTCMS end of things?

 

I’m using basic authorization with a valid account that was just created for me just for the express purpose of hitting REST API endpoints with it.

 

Thanks for the help.

 

Henry

 

 

 

 

 

Jason Tesser

unread,
Oct 10, 2017, 6:04:53 PM10/10/17
to dot...@googlegroups.com

seems to be saying it couldn't connect to dotcms. you could check the access log on dotcms to see if the request came through but probably a routing issue or wrong ip or something


--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB17001A7AA35D9B2144ACE97EAD750%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.

Mark Pitely

unread,
Oct 11, 2017, 10:01:26 AM10/11/17
to dot...@googlegroups.com
Henry,

It looks like it is trying to use port 8082. That would normally be firewalled, nor would dotCMS answer as normally configured. The API normally would only answer on 80 or 443.
onnection failed because connected host has failed to respond 52.6.25.245:8082

Mark Pitely
Marywood University

To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+unsubscribe@googlegroups.com.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+unsubscribe@googlegroups.com.

To post to this group, send email to dot...@googlegroups.com.

Henry Versemann

unread,
Oct 11, 2017, 10:17:51 AM10/11/17
to dot...@googlegroups.com

Mark,

 

Well that probably explains it, but I got that information from our backend’s content tab, as shown when I clicked “Show query” button. So after doing a search I used the query string shown in red underneath the line label below:

 

Rest API Call URLEncoded (Use this URL for external aplications or javascript on your page):

http://stchas.edu:8082/api/content/render/false/query/+contentType:Employees%20+Employees.firstName:*henr*%20+languageId:1%20+deleted:false%20+working:true/orderby/modDate%20desc

 

So you can see it gives the same port number that I’ve been trying to use and I just copied it and kept it in my query ever since believing it to be correct, as instructed in the line above itself.

 

So if that’s not a good port number to use then is that documented somewhere(it should maybe be on this page as well)? I ask because if that’s what my problem has been all along then by not explaining it better somewhere in the documentation, I have probably wasted several hours at least between last week Friday and yesterday, trying to get it to work using that port number.

 

I’ll try it with port 8080 or 443 if you think that that would be better to use.

 

Thanks for the help.

 

Henry

 

To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.

To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.


To post to this group, send email to dot...@googlegroups.com.

 

--

http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.

To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.


To post to this group, send email to dot...@googlegroups.com.

Jason Tesser

unread,
Oct 11, 2017, 10:21:50 AM10/11/17
to dot...@googlegroups.com
The port is configurable. What port do you connect to in your browser? 

Mark Pitely

unread,
Oct 11, 2017, 10:22:06 AM10/11/17
to dot...@googlegroups.com
Henry,

I said 'as normally configured' - perhaps your site runs on 8082 for some reason!
On your querying machine, make sure that it is allowed to communicate out on port 8082, if that is what your webserver works on.

Mark

To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+unsubscribe@googlegroups.com.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.

To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+unsubscribe@googlegroups.com.


To post to this group, send email to dot...@googlegroups.com.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+unsubscribe@googlegroups.com.

To post to this group, send email to dot...@googlegroups.com.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+unsubscribe@googlegroups.com.

To post to this group, send email to dot...@googlegroups.com.

Henry Versemann

unread,
Oct 11, 2017, 10:24:19 AM10/11/17
to dot...@googlegroups.com

On my browser I don’t normally specify a port number ever and just take whatever the default is.

Reply all
Reply to author
Forward
0 new messages