Integrating the Play Framework with existing Java EE applications
Is it possible to integrate the play framework into an existing Java EE project? I have a Java EE project that 开发者_开发百科serves up SOAP/XML based web services. I am unable to find anything related to handling the hosting of SOAP services with Play. I've found resources for creating XML results from running functions, but nothing to do with the definition, or handling of SOAP requests.
Sounds to me like you are asking two different questions:
- Is it possible to integrate the play framework into an existing Java EE project?
- How to define and consume SOAP requests using Play?
Response 1:
Please refer to the play war
command. It takes your play application and converts it to a war file ready to be deployed into a Java EE web app server.
Response 2:
Using play as a SOAP consumer should be straightforward: include the soap library of your choice, generate the stubs from the wsdl, call the endpoint. Another option is to call the URL and use Xpath to parse its envelope.
Defining SOAP services in Play is another story: SOAP is not a pure stateless stack. In other words it doesn't run well with Play (which typically doesn't hold state on the server). Note that it's probably a better choice to opt of JAX-RS services, in which case you can use this module
You may also use pure play controllers which are restfull by nature.
精彩评论