开发者

How can I build simple secure web service with Java?

Purpose of this web service is to server html/javascript/css/binary data inside simple XML document (or are there better suggestion for fromat? Could JSON be used for this kind of web service?) and requests requesting this data would be simple XML request containi开发者_Python百科ng 10-100 objects. By simple I mean not too complex framework that requires a lot of memory and classes. By secure I mean service that couldn't be easily abused by hackers.


Maybe REST with https. Take a look at Jersey and the Jersey User Guide. REST also offers 'native' support for different response representations. No need to wrap them inside XML.


SOAP over SSL, possibly using WS-Security to ensure identity (or alternatively using a servlet filter to do authentication based on credentials in the HTTP headers), does that quite nicely.

No need to reinvent the wheel :)


To me the simplest is Soap, Java automatically generates the WSDL and do all the XML stuff for you. You can use it on top of SSL secure transfers to add the security layer that you need. It is not unbreakable, but at least the data is not transfered in plain text.

Regards!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜