Expand my Community achievements bar.

SOLVED

Adaptive Form fails to make a REST call

Avatar

Level 3

I'm getting the following error when I submit my form. I have the submit action set to "submit to REST endpoint" and "enable POST request" checked with the path to the servlet.

wizard04wsu_0-1730318847631.png

30.10.2024 15:25:41.668 *ERROR* [[0:0:0:0:0:0:0:1] [1730316341654] POST /content/forms/af/poster-api-registration/jcr:content/guideContainer.af.submit.jsp HTTP/1.1] com.adobe.aemds.guide.service.impl.RESTSubmitActionService Failed to make REST call
org.apache.http.client.ClientProtocolException: null
...
Caused by: org.apache.http.ProtocolException: Target host is not specified

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 3

It is now working, but unfortunately I don't know what change actually resolved the problem.

View solution in original post

4 Replies

Avatar

Level 2

Hello @wizard04wsu 

 

Can you please confirm if your REST endpoint is hosted internally in the AEM server or on external server?

Can you try directly hitting that REST endpoint through postman with complete url and see if you are getting any response?

 

The error is pointing to "Target host not specified" which means the URL provided is not complete.

 

Thanks,

Rahul Pandey

Avatar

Level 3

It is hosted internally. I tried with postman this morning. It is getting a response with this error instead:

 

31.10.2024 10:05:35.030 *ERROR* [[0:0:0:0:0:0:0:1] [1730383535026] POST /bin/poster-api-auth0 HTTP/1.1] org.apache.sling.servlets.post.impl.operations.ModifyOperation Unable to create resource named poster-api-auth0 in /bin
31.10.2024 10:05:35.031 *ERROR* [[0:0:0:0:0:0:0:1] [1730383535026] POST /bin/poster-api-auth0 HTTP/1.1] org.apache.sling.servlets.post.impl.operations.ModifyOperation Exception during response processing.
org.apache.sling.api.resource.PersistenceException: Unable to create node at /bin/poster-api-auth0

...

Caused by: javax.jcr.nodetype.ConstraintViolationException: No default node type available for /bin/poster-api-auth0

Avatar

Employee Advisor

@wizard04wsu 

You can provide a path of the resource itself instead of the complete URL, to post data to an internal server.

Did you exclude the path "/bin/poster-api-auth0" from the authentication requirement under the "Sling authentication service" under http://host:port/system/console/configMgr

Avatar

Correct answer by
Level 3

It is now working, but unfortunately I don't know what change actually resolved the problem.