开发者

Webservice for a JSF application

We wrote a quite complicated application using a JSF + Spring + Hibernate. It has many business process. There are different kind of users (and roles). Users have to开发者_如何学Go fill many forms and when all the forms are validated the "order" is sent to the server and it will be processed by another kind of user.

Now we have to write webservices for this process. That is, "orders" are going to be sent batch using XML and an XML file containing error messages has to be returned in case of errors or an orderId has to be returned otherwise.

My question is manyfolded.

  • What should I take into consideration?
  • Should I use RestFul webservices
  • Should I use SOAP?
  • Should I use WSDL?

Any comment is welcome.

Thanks in advance.

Luis


If you consume your services your self you can go for annotations: Combining JSR-311 JAX-REST and JAX-WS annontations, then you can go for both on the server side, just use both annotations. Your business entities can be serialized with JAXB annotations. Run this in a webservice engine that supports both rest and ws. E.g. CXF handles both, but I beleive spring includes a WS lib to, don't know what that is based on.

If you have external consumers, my experience is (though I tend to not use it) to use contract first webservices. Otherwise small changes in your business model may cause updates to the wsdl that you may or mat not be aware of.

So: external consumers, go for contract first WSDL wbservice.

internal consumers (your code): use both and see what gets most convenient for you.

And, if you go for WS, do not use add on standards like WS-security and others, many clients run into problem then, because they may have support only for basic stuff.


I would use JBoss RESTEeasy, otherwise an implementation of JAX-RS, easy, lightweight -- very powerful and automatic conversion from XML->Objects->XML: RestEasy Docs

Completely driven by annotations, very simple takes about 5 minutes to set up. Works with existing domain objects.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜