开发者

Best practice Java technology for developing web services?

Could someone please recommend a suitable FOSS Java technology for developing a webservice with these requirements:

Needs to query an Oracle database, return XML data, and support rollbacks (so probably would have to maintain state in some way).

Currently I have a webservice written in PHP, but I've found PHP's support for SOAP limiting. I've looked at the various Sun Microsystems pages about their webservice offerings but find it baffling to choose between them. 开发者_如何学PythonIf someone could recommend a suitable direction it would be very useful.


Your service will have a hard time if it maintains state.

The very fact that you describe it in terms of an Oracle database and transactions indicates trouble. Start with the "service" that the component will provide and think in terms of the interface - the messages in and out. If you get those right you won't have any problem.

You're going to have to make a SOAP versus REST decision.

If you decide to go in the SOAP direction, I think the best way to develop web services is to use Spring's "contract first" web service approach. You'll start with an XSD for the messages and work from there. You aren't tied to an app server that way. It's especially good if you happen to be using Spring already. It can help with connecting to the database and declarative transactions as well.


In general, web services (SOAP or REST) are stateless. Transaction handling would generally occur inside the service itself. If the work completed successfully, a "good" response is returned and changes are committed. If the work failed, the work is rolled back and an "error" response is given.

For strictly the web service portion, I recommend AXIS (either 1 or 2). They are well supported Apache projects which have plugins for Eclipse and other IDEs. I don't use the Spring Framework, but I hear it's great for tying all the bits of your service together (database, web service, configuration, etc).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜