function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AruAruAruAru 

Hoovers Endpoint URL

Hi,

 

I am trying to invoke Hoovers API from Salesforce. I am getting the following exception. When i am trying to invoke the api from the VF page.

 

Exception:

System.CalloutException: Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = http://hapi.hoovers.com/HooversAPI-32 

 

I added the site in salesforce to the remote site, However it is saved in the below format.

I got the url from the Hoovers documents. http://developer.hoovers.com/docs34
Is it the issue with Hoovers Endpoint url or Salesforce not able to recognize the url.
Please suggest, 
Thanks,
Sunil
vishal@forcevishal@force

Hi,

 

Also try adding 

 

https://hapi-dev.hoovers.com in your Remote site settings (note that it is : https ). If even after this you are facing any error, then maybe we will need to go through the Documentation again.

 

Let me know if this helps.

AruAruAruAru

Hi Vishal,

 

I added the URL to the remote sites. However it didn't server the purpose. i am getting the same error.

 

System.CalloutException: Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = https://hapi.hoovers.com/HooversAPI-32 

 

This is sure the issue with the end point url, This is in the logs. Any other solution to get this work?

02:36:31.050 (50155000)|SYSTEM_METHOD_ENTRY|[61]|System.Http.send(APEX_OBJECT)
02:36:31.050 (50271000)|CALLOUT_REQUEST|[61]|System.HttpRequest[Endpoint=http://hapi.hoovers.com/HooversAPI-32, Method=POST]
02:36:31.052 (52324000)|EXCEPTION_THROWN|[61]|System.CalloutException: Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = http://hapi.hoovers.com/HooversAPI-32
02:36:31.052 (52432000)|SYSTEM_METHOD_EXIT|[61]|System.Http.send(APEX_OBJECT)
02:36:31.052 (52444000)|SYSTEM_MODE_EXIT|false
02:36:31.052 (52565000)|FATAL_ERROR|System.CalloutException: Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = http://hapi.hoovers.com/HooversAPI-32
AruAruAruAru

 

HI,

 

       I had a mismatch in the end point url which i fix. It seems to be ok now. However my request is not being processed.

This is the below error i am getting in the logs. It says invalid content type.

Error: 

SoapMessageCreationException: Could not create message from InputStream: Invalid Content-Type:application/x-www-form-urlencoded. Is this an error message instead of a SOAP response?; nested exception is com.sun.xml.messaging.saaj.SOAPExceptionImpl:

 

Full dubg stack trace. Please suggest

22:50:05.049 (49325000)|CALLOUT_REQUEST|[63]|System.HttpRequest[Endpoint=http://hapi-dev.hoovers.com/HooversAPI-34, Method=POST]
22:50:06.415 (1415757000)|CALLOUT_RESPONSE|[63]|System.HttpResponse[Status=Internal Server Error, StatusCode=500]
22:50:06.415 (1415861000)|SYSTEM_METHOD_EXIT|[63]|System.Http.send(APEX_OBJECT)
22:50:06.415 (1415946000)|SYSTEM_METHOD_ENTRY|[64]|System.HttpResponse.getBody()
22:50:06.416 (1416061000)|SYSTEM_METHOD_EXIT|[64]|System.HttpResponse.getBody()
22:50:06.416 (1416132000)|SYSTEM_METHOD_ENTRY|[64]|System.debug(ANY)
22:50:06.416 (1416175000)|USER_DEBUG|[64]|DEBUG|<html><head><title>JBossWeb/2.0.0.GA_CP - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.ws.soap.SoapMessageCreationException: Could not create message from InputStream: Invalid Content-Type:application/x-www-form-urlencoded. Is this an error message instead of a SOAP response?; nested exception is com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:application/x-www-form-urlencoded. Is this an error message instead of a SOAP response?
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:656)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	com.dnb.applications.webservice.filter.MDCFilter.doFilter(MDCFilter.java:72)
	org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
</pre></p><p><b>root cause</b> <pre>org.springframework.ws.soap.SoapMessageCreationException: Could not create message from InputStream: Invalid Content-Type:application/x-www-form-urlencoded. Is this an error message instead of a SOAP response?; nested exception is com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:application/x-www-form-urlencoded. Is this an error message instead of a SOAP response?
	org.springframework.ws.soap.saaj.SaajSoapMessageFactory.createWebServiceMessage(SaajSoapMessageFactory.java:171)
	org.springframework.ws.transport.AbstractWebServiceConnection.receive(AbstractWebServiceConnection.java:86)
	org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:86)
	org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
	org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:230)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	com.dnb.applications.webservice.filter.MDCFilter.doFilter(MDCFilter.java:72)
	org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
</pre></p><p><b>root cause</b> <pre>com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:application/x-www-form-urlencoded. Is this an error message instead of a SOAP response?
	com.sun.xml.messaging.saaj.soap.MessageImpl.identifyContentType(MessageImpl.java:600)
	com.sun.xml.messaging.saaj.soap.MessageImpl.&lt;init&gt;(MessageImpl.java:273)
	com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl.&lt;init&gt;(Message1_1Impl.java:68)
	com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl.createMessage(SOAPMessageFactory1_1Impl.java:62)
	org.springframework.ws.soap.saaj.SaajSoapMessageFactory.createWebServiceMessage(SaajSoapMessageFactory.java:154)
	org.springframework.ws.transport.AbstractWebServiceConnection.receive(AbstractWebServiceConnection.java:86)
	org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:86)
	org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
	org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:230)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	com.dnb.applications.webservice.filter.MDCFilter.doFilter(MDCFilter.java:72)
	org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
</pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the JBossWeb/2.0.0.GA_CP logs.</u></p><HR size="1" noshade="noshade"><h3>JBossWeb/2.0.0.GA_CP</h3></body></html>
22:50:06.416 (1416647000)|SYSTEM_METHOD_EXIT|[64]|System.debug(ANY)
22:50:06.416 (1416685000)|SYSTEM_MODE_EXIT|false
22:50:06.420 (1420264000)|CODE_UNIT_FINISHED|HttpCallout_CLS invoke(sendRequest)
22:50:06.421 (1421454000)|VF_APEX_CALL|j_id30|{!sendRequest}|PageReference: none
22:50:06.431 (1431035000)|VF_SERIALIZE_VIEWSTATE_BEGIN|06690000000paJ2
22:50:06.434 (1434440000)|VF_SERIALIZE_VIEWSTATE_END
22:50:07.092 (1437604000)|CUMULATIVE_LIMIT_USAGE
22:50:07.092|LIMIT_USAGE_FOR_NS|(default)|