How to resolve Connect to api.smartsheet.com:443 [api.smartsheet.com/ip] failed: Connection refused: connect? - smartsheet-api

I am trying to Get Response from API through Httpclient, but I am getting
org.apache.http.conn.HttpHostConnectException: Connect to URL failed:
Connection refused: connect error.
I am able to get the response using PoSTMAN Tool but not through ecclipse when I am accessing through office domain even after setting proxy.
I am using Eclipse. Could you please let me know how to resolve this issue? I am stuck with issue.
Thank you In advance
mentioned the https protocols as well in system properties
java.util.Properties systemProperties = System.getProperties();
systemProperties.put("https.protocols", "TLSv1.2");
Smartsheet smartsheet = new SmartsheetBuilder().setAccessToken(accesstoken).build();

With the Smartsheet Java SDK you can implement proxy by overriding the default HTTP client. An example is in the Advanced Topics document here: https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/master/ADVANCED.md#sample-proxyhttpclient

Related

Not able to access AEM author using JcrUtils.getRepository with https

I am trying to access the repository from a standalone java application using JcrUtils.
**repository = JcrUtils.getRepository("http://localhost:4502/crx/server"); this works**
**repository = JcrUtils.getRepository("https://localhost:4502/crx/server"); this doesn't work**
Exception in thread "main" javax.jcr.RepositoryException: Unable to
access a repository with the following settings:
org.apache.jackrabbit.repository.uri: https://localhost:4502/crx/server The following
RepositoryFactory classes were consulted:
org.apache.jackrabbit.commons.JndiRepositoryFactory: declined
org.apache.jackrabbit.core.RepositoryFactoryImpl: declined
org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory: declined
org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory: declined Perhaps the repository you are trying to access is not available at
the moment. at
org.apache.jackrabbit.commons.JcrUtils.getRepository(JcrUtils.java:223)
at
org.apache.jackrabbit.commons.JcrUtils.getRepository(JcrUtils.java:263)
at com.hero.jcr.util.CqHelper.getSession(CqHelper.java:20) at
com.hero.jcr.commandline.CheckConnection.getDamAssets(CheckConnection.java:36)
at
com.hero.jcr.commandline.CheckConnection.main(CheckConnection.java:29)
Thanks in advance
The problem can have different causes.
HTTPS configured and on which port
It looks like you're trying to access http and https in the same situation on the same port. Http and Https don't run on the same port in parallel.
Please use the SSL Wizard as hinted by ronnyfm to check if SSL is activated and on which port it is used: https://docs.adobe.com/content/help/en/experience-manager-65/administering/security/ssl-by-default.html
For instance the default port for https in AEM is 8443, so try https://localhost:8443 to access it, if you have configured it there.
Untrusted Certificate
Also connecting to https might not work if you use an untrusted certificate, which you need to add to the Java security keystore first. In my case I got the same "Unable to access" message, because the original exception regarding the certificate got silently swallowed in the JCR library I was using.
Wrong certificate
When you added the certificate to the keystore and it still doesn't work, check if the certificate was created for them same host you request. If you created it for bla.host, but try to access it via localhost, it also gives you the same exception, while the original message is silently swallowed.

How to connect from Advance Rest Client to Tableau Server?

I have used the below url to connect to server from Advanced Rest Client
http://xx.xx.xxx.xx/api/2.0/auth/signin
I get the error
Requested Url cannot be reached. How to solve this?
The version of the REST API to use depends on the version of Tableau Server that is in use, and so I suspect that you're trying to use the wrong API version. Try the following link for more information:
https://onlinehelp.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_versions.htm

Unable to Consume Web-service in Eclipse

I am trying consume a webservice hosted by
http://www.webservicex.net/CurrencyConvertor.asmx?WSDL
but eclipse showing "The service defintion selected is invalid"
I did check the followings:
1.opened the above wsdl url in ie and xml displayed properly
2.eclipse have network connectivity,it shows list of update when help-->check for update is clicked
3.Downloaded a copy of the wsdl and was able to generate client components.But when i tried to invoke a method i am getting connection refused error
{http://xml.apache.org/axis/}stackTrace:java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195
I was able to solve this by a correct proxy in JVM arguments.The problem was as i was under a corporate proxy firewall,My java was failing to retreive the wsdl from the external link.Hope it helps to somebody who have similar issue.
Make sure that:
Tomcat is running under the server tab during your are doing this step.
choose the right Apache axis under Web service client in the configuration.

enable http-bind on openfire

I am trying to enable BOSH connection over Openfire so that i can create a XMPP client over a web. curretly i am testing it with the strophe.js.
the problem is when i try to fire following url in a browser i am getting
http://www.mydomain.com:7070/http-bind
following error
HTTP ERROR 400
Problem accessing /http-bind/. Reason:
Bad Request
Powered by Jetty://
here is my server setting , i saw few threads but they arent helpful
update
i have made a connection using strophe but i am getting following error in browser trance
its now working in my system.
i think your error encountered may actually be a configuration issue with the openfire.
It is designed to reply with HTTP 400 Bad Request if there is no element in the request. You can test this yourself by providing a element in your query.
Try the following URL in your browser:
http://www.servername:7070/http-bind/?<body rid="1"/>
In your update Strophe is sending OPTIONS HTTP requests which means that it is negotiating cross domain communication. Requests are painted red which means that this is failing for some reason. Probably misconfiguration.
There is a nice article about that here: http://metajack.im/2010/01/19/crossdomain-ajax-for-xmpp-http-binding-made-easy/
Otherwise, when Strophe does its regular BOSH communication it uses POST method.
Your setup is correct. The page the browser displays to you is also normal. Openfires BOSH component is not designed to work in a Browser with HTTP GET, only with BOSH clients like strophe. Try to connect with strophe.
You should use proxy to repost the request to the openfire server . Because, the js post cannot support cross domain.
Notes:
1.I use jsjac , but I think it's not important .
2.If you sure your config is right , please restart you openfire server . It's my experience .
If server is properly configured it should display
HTTP ERROR: 404
Problem accessing /http-bind/. Reason:
Not Found
Powered by Jetty://
The Bad Request was gone when I uninstall and reinstall Openfire as in
here.
Below works for me, i am pinging the openfire server after some interval so, clients remains alive...
i just append "/?<body rid='1'" with the server name and i don't have 400 bad request error.
XMPPconnection.sendIQ($iq({ to: XMPPserver+"/?<body rid='1'/>", from: CurrentUserJID, type: "get" }).c('ping', { xmlns: "urn:xmpp:ping" }));

I am getting SSL Error, while trying to communicate with the server through my iphone app

I am getting an error "An SSL error has occurred and a secure connection to the server cannot be made".
Same code is working fine while communicating with another server, i want to make sure whether the issue is due the certificate on server.
Its because of the server that you are hitting is HTTPS server. It requires an SSL check.
please check the url of the server you are communicating with , it must be using HTTPS , try using the service with HTTP.