Hi Michael,

AFAIK magnolia doesn't provide anything directly here, but it's easy to do. 
We've integrated SOAP WebServices via Axis, and more general REST Services via 
commons-httpclient. Both are working well, and weren't hard to implement.

If you're handling the communication yourself, I would use something like 
Apache commons-httpclient which makes http-requests a bit easier to handle than 
just using an URLConnection. In particular, for SSL-Auth take a look at 
AuthSSLProtocolSocketFactory and associated documentation. You'll only need to 
mess with trustStores and such if you need to accept self-signed certs from the 
server, or need client-authentication.

If you want a bit more "structure", using SOAP via Apache Axis, or using the 
Restlet (www.restlet.org<http://www.restlet.org>) framework can be good 
solutions. Both allow configuring SSL authentication.

Depending on your application, you can perform the backend calls in the execute 
methods of your Model classes. That's a synchronous way of doing things, so 
your requests will take longer to process since the backend-call has to 
complete before page rendering proceeds. One way to mitigate that is to render 
the basic layout of your pages without any backend-requests, and use AJAX and 
Magnolia's direct-paragraph-access feature to render individual paragraphs that 
make the backend requests once the main layout has loaded.

Also, remember that there will potentially be many parallel requests, so you 
need to do things like use the MultiThreadedConnectionManager (if using 
commons-httpclient) and consider synchronization if using shared resources.

Regards from Vienna,

Richard






Von: [email protected] [mailto:[email protected]] 
Im Auftrag von Michael Wechner
Gesendet: Dienstag, 13. März 2012 09:09
An: [email protected]
Betreff: [magnolia-user] Using SSL to connect from Magnolia (acting as client) 
to another server

Hi

What is the best way to connect from within Magnolia (acting as a client) with 
SSL to another server, e.g.
some REST based back-end service?

I guess one possbility would be to set system properties such as for example

javax.net.ssl.trustStore

inside my custom code?

Or is there a more generic way how to do something like this with Magnolia?

Thanks

Michael

________________________________
----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: 
<[email protected]<mailto:[email protected]>>
----------------------------------------------------------------


----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to