Apache CXF custom transport module for using SOAP with Play Framework.
A detailed tutorial about using it is available at http://www.imind.eu/web/2013/11/07/developing-soap-services-using-play-framework-2-2-x/
Apache CXF custom transport module for using SOAP with Play Framework.
License: Apache License 2.0
Apache CXF custom transport module for using SOAP with Play Framework.
A detailed tutorial about using it is available at http://www.imind.eu/web/2013/11/07/developing-soap-services-using-play-framework-2-2-x/
In my fork I have already removed DelayedOutputStream
and substituted it with just a ByteArrayOutputStream
, so that I could shrink the handle
method in CxfController
down to
val delayedOutput = new ByteArrayOutputStream
val replyPromise: Promise[Message] = Promise.apply()
dispatchMessage(extractMessage, delayedOutput, replyPromise)
replyPromise.future.map { outMessage =>
Ok(delayedOutput.toByteArray) withHeaders(
Message.CONTENT_TYPE -> outMessage.get(Message.CONTENT_TYPE).asInstanceOf[String]
)
}
So far, I haven't found any problems in doing so, and the response time improved by nearly 200ms in my test environment. I'm curious if there was a reason in using the DelayedOutputStream
rather than the direct dump of the byte array? I would gladly set up a pull request if this change is acceptable.
Play 2.6 branch
When I add a soap:address to the wsdl service like below than I get a No DestinationFactory was found for the namespace http://cxf.apache.org/transports/http
error.
<wsdl:service name="CoffeeService">
<wsdl:port name="CoffeeServicePort" binding="tns:CoffeeServiceSoapBinding">
<soap:address location="https://localhost:9000/service/coffee"/>
</wsdl:port>
</wsdl:service>
Is it possible to use Play dependency injection in service implementation class?
Hi
I have a requirement that responses cannot be chunked due to old devices not supporting this.
I am currently using your 2.6 branch deployed on bintray. And it works wonderfully but always return chunked. Does older versions of play handle this differently? Is it possible at all in play?
Generated wsdl does not have soap:address tag in wsdl:service tag and then the client can not consume service! i encounter following errors:
Invocation without a binding operation.
or
Unsupported endpoint address
Hi there,
I believe that you are responsible for a documentation under http://www.imind.eu/web/2013/11/07/developing-soap-services-using-play-framework-2-2-x/ address. Am I right?
If yes, that's amazingly annoying when I am not able to select any text from a documentation. I can disable -webkit-user-select every single time but why?
The play-cxf_play26 version 1.3.0 is not in the central repo.
see: https://mvnrepository.com/search?q=eu.imind.play
When running the sample app in the play-2.6.x
branch, I get an unresolved dependencies: eu.imind.play#play-cxf_play26_2.12;1.3.0: not found
I got these logs messages in SoapUI:
Wed Sep 16 11:55:23 ART 2015:INFO:Finding importer for {http://localhost:9000/service/person}PersonServiceImplServiceSoapBinding
Wed Sep 16 11:55:23 ART 2015:INFO:Missing importer for {http://localhost:9000/service/person}PersonServiceImplServiceSoapBinding
The wsdl response is:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://services/" xmlns:ns2="http://cxf.apache.org/transports/play" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://localhost:9000/service/person" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="PersonServiceImplService" targetNamespace="http://localhost:9000/service/person">
<wsdl:import location="/service/person?wsdl=PersonService.wsdl" namespace="http://services/" />
<wsdl:binding name="PersonServiceImplServiceSoapBinding" type="ns1:PersonService">
<soap:binding style="document" transport="http://cxf.apache.org/transports/play" />
<wsdl:operation name="getNames">
<soap:operation soapAction="" style="document" />
<wsdl:input name="getNames">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="getNamesResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="PersonServiceImplService">
I can't test the web service made with play-cxf.
I have Play Framework 2.4.3 (java) and implemented my web service according to your instructions here http://www.imind.eu/web/2013/11/07/developing-soap-services-using-play-framework-2-2-x/
Unfortunately I get compilation error:
(...)/conf/routes:31: type CxfController is not a member of package org.apache.cxf.transport.play
It is related with routes. I have no idea how to fix it. Could you help me?
I am attempting to upgrade to Play 2.4 but I get an exception. Not sure if the source is this plugin but it looks like it.
play.api.UnexpectedException: Unexpected exception[BeanCreationException: Error creating bean with name 'org.apache.cxf.transport.play.CxfController#0' defined in class path resource [cxf.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.cxf.transport.play.CxfController$]: Factory method 'getInstance' threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.apache.cxf.transport.play.CxfController$]
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:165) ~[play-server_2.10-2.4.2.jar:2.4.2]
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:121) ~[play-server_2.10-2.4.2.jar:2.4.2]
at scala.Option.map(Option.scala:145) ~[scala-library-2.10.5.jar:na]
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:121) ~[play-server_2.10-2.4.2.jar:2.4.2]
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:119) ~[play-server_2.10-2.4.2.jar:2.4.2]
....
Is it possible with this module to achieve thread safe request context? I found some documentation on official cxf website (http://cxf.apache.org/faq.html) and that part of code:
((BindingProvider)proxy).getRequestContext().put("thread.local.request.context", "true");
In my project, I have to utilize services like this :
http://212.16.81.29:8011/MaliatWS.asmx?wsdl
As you mentioned in your guidance, we have the following dependency in build.sbt :
libraryDependencies += "org.apache.cxf" % "cxf-rt-frontend-jaxws" % "3.1.2"
Unfortunately, this dependency causes problem for using that service. and it shows the following exception :
javax.xml.ws.soap.SOAPFaultException: Play! Transport doesn't support client operation mode!
When I omit that dependency, there is no problem. But for SOAP service we need that dependency.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.