I'm trying to implement a desktop application that could send http messages to an already open local web application so that it will be updated with this information.
Any suggestions?
The only idea I came up with is sending http requests to the relevant web server and implementing on the web server a servlet that will update the relevant web page according to userID.
Anyone has a more elegant solution?
As far as I understand you you want to implement servlet that performs HTTP connection to other, external server. If I am right the following discussion will help you:
How do I make HttpURLConnection use a proxy?
Take a look on the answer that explains how to use Proxy class introduced in java 1.5.
Related
I've been asked to look into adding an LDAP interface to an existing Java web application - that is, to make it possible for LDAP clients to connect to the application as if it's an LDAP server. I could write code to listen on a dedicated port and implement the LDAP protocol, and hook that into the existing database... but I'd have to understand the protocol first and then there are potential security issues if I write that from the ground up (not to mention the time it could take).
What I'm looking for is a library of existing code - something that handles the ports and protocols, and lets me focus on writing just the back end. There are plenty of client-side libraries out there, as you'd expect, but I've had no luck in finding something to help with server-side development. So the question is, does anyone here know of such a library that would help with this?
Yes you will most probably find many more client implementations than server, however LDAP is a request response protocol, so with a bit of playing around you should be able to use the same classes and their serialization capabilities. Instead of sending the request you would be receiving it, and responding with the response you would otherwise expect from the client.
You could look at the Apache Directory. https://directory.apache.org/api/
It has an embedded directory server project as part of it, which claims to be extensible and embeddable in your application. https://directory.apache.org/apacheds/
So maybe that could be the answer to your needs.
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 need to implement a server that downloads a webpage and sends it to a client that saves it as a file.
On the server side I need to process socket.
So I was thinking about making a web service in java (with netbeans) but I don't know how to start the web service (I use osx lion).
How can I start the web service?
Is there another way to solve my problem?
Thanks
I'd strongly consider just using an HTTP-based RESTful client/server, using any of a million server-side frameworks. The server-side option may influence the client side implementation.
For example, you could use something like Jersey, which can also create the client-side library needed to consume your service.
On the server side I'd use something like HttpClient to retrieve the websites that will be returned to the client app.
I would like to use AWS and especially Amazon Simple Email Service (SES) in order to setup a webservice allowing to send emails.
Emails would be triggered by some kind of POST request to the webservice with some authentication, and the webservice would then just send the email on behalf of the web service user.
Where should I start? The webservice part looks dead simple but I'm not familiar at all with web services. I still need to run some kind of multithreaded webserver since there could be a bunch of concurrent requests.
Is there a way for me to write a very simple web server in Ruby or Java to do that? Any pointer appreciated.
After some digging, the simplest solution is to use something like node.js or sinatra. The nice thing is that these are almost self-contained and require barely any configuration. They provide a very easy way to reply to HTTP requests.
Once you get one of these, you start the script with a port.
The small webservice will now listen on that port. You only need to take action based on the requests passed as parameter.
And yeah, now it sounds so obvious...
their documentation is good way to start. its quite easy to start, may encounter difficulties based on your problem domains.
you also need to implement something on top of this service.
http://docs.amazonwebservices.com/ses/latest/DeveloperGuide/index.html
http://docs.amazonwebservices.com/ses/latest/APIReference/
http://docs.amazonwebservices.com/ses/latest/DeveloperGuide/
Good Luck!
I would start with looking at AWS sdk Java.
They seem to support SES.
http://docs.amazonwebservices.com/AWSJavaSDK/latest/javadoc/index.html
Good Luck!
I am working on an application that needs to be able to post to HTTPS and keep track of the session that is created by authenticating to the https server. Is there anything in java and android that handles this better than just using the http methods offered by java? Like the HttpsURLConnection.
Thanks!
This depends on what you mean by "better". HTTPURLConnection works well for many cases but if this is not enough, you may look into HTTP Core from Apache. I understand that HTTP Core can work on Android.