I am working on a web based Java application(on localhost) and I want to send email using a PHP script which is hosted on a free web hosting site and also return to my java app.
Like this ->
Java(localhost)---->PHP(send mail)---->Java(localhost)
Few questions regarding this?
How to do this?
What about the session stored by the java app? Will the PHP script
read or interpret java's session?
My suggestion is Implement an web service (in REST or SOAP Architecture) with php
then in java code call your web service and Implement an acknowledgement response for
successful or failure mail sending operation in your php!
SOA (Service Oriented Architecture) could be one of best approach for communication between
different platforms.
if you use php only because of ease of sending mail it would be fine to know that java also
have JavaMail API that can be used for mailing application very easily
I hope it be beneficial
Regards
Related
In my project need to create the following architecture:
Front-End application is a web site resource that will combine HTML+React technologies.
Back-End is a java application that will be connected to Mongo DB to operate with data.
Now, in the middleware should be placed Node.js. And after reading a lot of info on the internet, I have now some confusions regarding this.
As I understand Frond-End will be routed to node.js (and now the question is it Express.js-- the same thing or it's different) which is also connected to Mongo Db and Java application(this is doing all logic).
Can someone explain me should use express.js with the integration of node.js in order to route to java server application?
If you want to use a middleware. Nodejs can help you do that in a lot of ways, you can use express.js so that you won't have to do more request/response parsing work. And when you want to connect to your java server using nodejs, you can also integrate that by calling the java server API endpoint by using some http library like axios then you can directly communicate to java server app to directly communicate to the backend mongodb.
But your Front-End application can also directly communicate through your backend java by creating a REST API. And store all your business logic in the java REST API.
Im developing a java application that provides some methods using restlet to a android app.
I created the server and the client using this tutorial
(GAE server and Android client)
Now I need to make a PHP client that is able to access that data. Is that possible? What is the best way to do it?
I already tried to get the data using Advanced REST client but restlet always provide a 404 error
Edit: I can use any web language, PHP was used as an example
I ended up using a restlet extension
I hope it helps somebody else ;)
Restlet provides a way to implement RESTful applications. They are independent from the client so you should be able to consume them with any language.
I would recommend you to enable traces on the server side to find out what happens:
Engine.setLogLevel(Level.FINEST);
You can try to use curl to have a low-level view of exchanged messages (address / path, headers and payload).
Hope it helps you,
Thierry
I have a diagram editor application (client), which is written in javascript. I need to take the model of the diagrams (can be transformed to text), and synchronise it with my GAE Java application which will be my backend. The application will then store this model on cloud, or send it to other clients. (as a result many people work on same diagrams)
This is a totally new field to me, and even though I completed some of the tutorials google provides, and gone through documentation, I am not sure how the connection will be done (tutorials used JSP).
What is the most straight- forward approach into connecting a Java
application (GAE) with a JS client ?
p.s: I have read about ajax, but I dont know if its the right solution for this, or if there is a better one.
What is the most straight- forward approach into connecting a Java
application (GAE) with a JS client ?
Through an API built on HTTP. Your JAVA web app can expose certain endpoints. You can then use Javascript to make http requests, (through AJAX) to your java web api). This is currently the defacto way of communicating from front end with javascript to any backend service.
There will be some trickiness to supporting real time collaboration between clients.
Additionally, there has been increasing support for websockets, which allows you to open a persistant connection between your client and your server, i don't know if java on GAE supports it though...
I am developing a php based application which has java as middleware for web services. Is there any frameowork/middleware available in php stack which allows me to write services in php and also hosted on php based app server, lets say Zend?
Thanks
Typically I'd expect the middleware to be the webservices - are you consuming or providing webservices using PHP?
Not that it makes much difference, PHP supports both.
You can roll your own solution, or use PHP Soap, the nuSoap PHP lib and xmlrpc. There's also the php/java bridge which implements a socket based abstraction for both ends (but obviously this is not strictly a web service).
I am new in this area and I want to know how could I develop such an application. I already have a developed application in java (the business logic) and I would want to link this with a
web application in ASP.Net (application client). I know that I must use a web service but which type should I use a java web service or a .Net web service.
I dont know how to make this connection between the .net and java, could anyone help me please? Is this possible through the web service? Any action of the user would then be transmitted to the java application...and if this is the case how it is done? Any example or tutorial might be hepfull....
Thank you in advance
If you write a SOAP web service, it doesn't matter whether you use Java or .NET. The client is exchanging SOAP XML messages over HTTP; the language that the service is written in does not come into play.
Same would be true of REST if you did it properly.