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!
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 must create a desktop java client that comunicate to a servlet in order to receive some notificationes.
The servlet is an async servlet but my doubt is with the client.
How is the best way to "listen" a response from the server. I looked to the httpcomponents-asyncclient from apache, but I´m not trully convinced about that library. Maybe an infinite loop?
You might want to check out netty, it's what we use for our IntelliJ IDEA real time collaboration plugin to communicate with our remote server. It's very simple to get started with and abstracts all the hard parts, including creating secure connections. This is the netty user guide, it should get you started.
HttpComponents from Apache is very common
(be careful not to use the old one). Check a simple example.
Do you need to be constantly waiting for responses? If so, this is not the correct direction! The client should not have to call any method to get notifications... it should just be listening to some socket that the server writes to... Or just processing some queue. Perhaps you need to consider learning a bit of real time technologies and methods.
One desktop application needs to get some services from server.
For example sending some parameters and receiving some result.
Imagine implementing a solution by Java Servlets, in a way that the app sends the parameters to the servlet (POST) and receives the result in XML.
Does this approach have any security issue in compare with web-services (Soap / Restful) ?
Thanks and sorry if the question is a bit general.
I don't think so. But personally I would still go over REST, mainly because it would be easier to maintain and update if needed. Also probably easier to test and implement.
As long as your solution has suitable authentication (username/password) and takes place over SSL, it's no less secure than Web Services/SOAP. And indeed you might find it a simpler solution to implement.
The security issue is the same for both solutions because it's http but I won't do the post thing because it's not structured properly, meaning it's client dependent and not using a standard. If you don't like XML, you can try JSON.
I am currently using various back-end services and I want to use PHP to simply query these services and perform the final page construction. These services could be coded in any number of programming langauges such as Erlang, Java, Python etc. However I am unsure of the best way to actually interface the back-end services with the web app. Requests to these services would be both synchronous and asynchronous. Would I use something like SOAP or JSON-RPC??
Any help greatly appreciated.
You might want to have a look to Thrift:
http://incubator.apache.org/thrift/
I think you are on the right track
using JSON-RPC. I don't like SOAP at
all because it is just way too
complicated in my opinion
I would create an interface(document it properly like for example twitter) which I can easily test using cURL from the command line.
I think Twitter has a pretty good(not perfect) API.
Also ProgrammableWeb.com is a good place to look up API's(see how other people create API's).
This is a general question how to design web services and there is a hype using REST-like web services. This way you simply can call a given URL (which is even user readable). This increase the interoperability of your web service so you can mix the programming languages which use the REST interface. IMHO its easier than using a SOAP like web service as you simply calls GET on an url like http://www.example.com/user/5/ (think of it as the mod_rewrite of web services)
I'd use NuSOAP (to consume java webservices).