Access data received by the HTTPs endpoint by my java console app - java

I'm using mongoDB to store and read data from my Java application. My application, in addition to working with the MongoDB database, works with an API for sending messages via whatsapp. Everything is working so far, but I need to get the "webhook" sent by this external service, I managed to configure an HTTPS Endpoint in Realm, I would like to know if it is possible to read this data through my Java console application. I tried to synchronize the Realm with the database but I was unsuccessful, the idea was to record the data received by the HTTPS endpoint in a collection and access it through my Java application.
Thanks to everyone who can contribute with any suggestions.

Related

How to query data from BigQuery using JAVA API

We have a api project written in JAVA using spring hibernate and reading data from MySQL. Recently, we added another data source as BigQuery, therefore we want to allow user to call certain apis to query data from BigQuery - order count from orders table in BigQuery using JAVA api client. Looked at the github sample, but not clear about how to setup and access.
Also found this link but not sure about registering a web application, etc. Please advise.
Update: Imagine this as a web application which shows count of orders in the last 5 days if I select a merchant. but the orders table is in BigQuery. My web application calls-> java api layer which calls -> bigquery using client library -> populates the response as a json -> web application receives the count of orders.
I feel the hiccup is in authenticating using GoogleCredential. Generated a new Oauth Client Id which provided a client_id and client_secret. But still it is not able to authenticate to the project and give results.
Thanks.
Since your question is generalized, I believe what you need is to understand Google's BigQuery on how it works, how to setup the data etc.
Once you setup the data in BigQuery, you can access BigQuery by using a web UI or a command-line tool, or by making calls to the BigQuery REST API using a variety of client libraries such as Java, .NET or Python
You also haven't mentioned that whether you have gone through the basics.
I hope this link will be helpful in understanding how to import data to BigQuery and setting up the data, querying etc.
Use Service Accounts to connect to your BQ.
And please be aware that the response time will be 2-3 seconds as this is a big data tool not a real time db for web use. Not sure if that's how you want your web application to work. You may need to cache the number in your local database.

Server to Server communication with IBM SBT

I would like to use the IBM SBT for server to server communication instead of displaying data from , for instance, connections at the user. In this particular usecase I would like to have data updated in Connections whenever a user saves or edits data.
Because we are not using oAuth we would like to use Basic authentication without prompting the user for authentication. Are there any examples how to do is?
yes there are some examples of using Pure Java, no J2EE.
http://bastide.org/2014/01/28/how-to-develop-a-simple-java-integration-with-the-ibm-social-business-toolkit-sdk/
and
https://github.com/OpenNTF/SocialSDK/blob/master/samples/java/sbt.sample.app/src/com/ibm/sbt/sample/app/BlogServiceApp.java
Essentially, you'll need the dependent jar files.
once, you have the jar files you need to configure your class so you can get an Endpoint
once you have the endpoint you can use the endpoint in one of the top level services such
as ForumsService
then you can use the ForumsService to call back to Connections

how to communicate from javascript to java application

I am storing data in a cloud in some format. This cloud is accessible through https URL. There are java and java script API's to communicate with cloud. I want to provide basic CRUD functionality. I have a textarea in which I am receiving input from the user. I have a java library for parsing the SQL queries. How do I communicate from javascript in my HTML page to java application where it performs computation on data on cloud and communicates with cloud.
I am a newbie at web development. I appreciate any help!!
Google ajax.......
With Ajax, web applications can send data to, and retrieve data from, a server asynchronously (in the background) without interfering with the display and behavior of the existing page. Data can be retrieved using the XMLHttpRequest object. Despite the name, the use of XML is not required (JSON is often used instead), and the requests do not need to be asynchronous.
http://en.wikipedia.org/wiki/Ajax_(programming)
http://howtodoinjava.com/2013/06/21/complete-ajax-tutorial/
https://netbeans.org/kb/docs/web/ajax-quickstart.html
http://javapapers.com/ajax/getting-started-with-ajax-using-java/

iPhone/iPad app development connect to a java http server

Ok so I am still new to Objective C and currently learning it. I wanted to make an app where people can login and submit data to a database. I have research and found that I need to connect to a web server (I will use a Java web server) and from this server, it will communicate to the database server.
However, I am just wondering exactly how I would connect from an IPad app (that I will make in the future) to a Java App Server such as Glashfish. To do this, what kind of web app would I make (servlets?)? If I did, would I use the URL wrting method to transfer data?
I would want to use a http connection since I am using Glassfish.
Thanks
You can expose Restful API through the java web application; and access these api in your iOS app. There are many rest-client library for iOS now.
You can also write data to url connection directly, but it's tedious and complex.

How do I manage HTTP communication between a Apache web server and Google App Engine?

I am currently developing a web application in the Google App Engine using Java and PrimeFaces. I have to access a remote MySQL server, my clients website's database. This website contains all the data which my application requires.
I have searched the web and found out that there is no direct method to access any database with Google app engine.
So I decided to create a PHP script on the web server which will accept SQL queries as HTTP requests on behalf of the MySQL server and send the returned data as a HTTP response. (Encrypted of course!)
How can I send a large result set over HTTP from a PHP web server to Google App Engine?
The problem I am facing here is that, although I can manage to get a HTTP request via GET in PHP. How do I send them back, just flushing wont do, and how do I redirect them back to the Google App Engine's my application specifically.
Thanks!
You can use the UrlFetch api to send requests from appengine to your MySQL server. You'll get a response, and can parse it directly in appengine.
You can set up servlets in your appengine app that your MySQL server can trigger with requests. Your MySQL server can send a request (your php GET function) to yourapp.appspot.com/servletpath, which will start your appengine servlet. Appengine can return a response from there.
If dataset is too big to be transferred in one lump then just split it over several requests by adding a range limit to your query. Also make use of task queue to split this job over several tasks. It is common practice on appengine to split everything what takes too long/too big into several tasks. Divide and conquer.

Categories

Resources