Playframework 2 as a SOAP server

I like Play 2.0 a lot (especially the Scala API). But he lacks SOAP completely. Is there any unreasonable way to provide SOAP WS (wsdl based) from Play 2.0?

Say I want it to be accessible from some URL (e.g. / soap) while saving other pages in HTML format. Please help, I don't have a clue (I'm java newb, and the zillions of abbreviations for frameworks and libs confuse me).

PS To prevent possible unproductive calls: I am java newb, but not a beginner programmer, so I know how SOAP, HTTP and other materials are designed to work at the protocol level.

+6
source share
2 answers

I encountered the same problem - Apache CXF and Axis2 depend on the servlet API, which is not in the Play Framework.

I created a custom transport plugin for Apache CXF that connects to the Play Controller API. There is a tutorial on how to configure all this in an empty project: http://www.imind.eu/web/2013/11/07/developing-soap-services-using-play-framework-2-2-x/

The source of the plugin (and a sample Play application) is here: https://github.com/imindeu/play-cxf

+5
source

If you are trying to create a web service API for existing business logic that will be part of your Play service, then you should probably look using existing Java libraries that can use SOAP magic for you (for example, Axis2 ). Scala can easily use existing Java libraries.

However, most people strongly recommend that you watch the REST service, not the SOAP service, if this is an option. Check out the Play Mini to see how it's done.

UPDATE:

Ah, this can help you: https://github.com/mandubian/scala-xmlsoap-ersatz

+3
source

Source: https://habr.com/ru/post/920872/


All Articles