Using StAX Parsing with JBoss4.0.5.GA

In my previous post (here) I described how to combine Spring WS with StAX parsing the SOAP messages. I ended with generating the WSDL as a test and said you could use Soap UI for testing the web service.
Well, I did. And I was running into the following error when I had deployed my web service at JBoss4.0.5.GA:

<env:Envelope xmlns:env="">
         <faultstring>Operation only supported for javax.xml.soap.Node, this is a [#comment: Test comment]</faultstring>

I fixed the issue by adding the following dependencies to the project’s pom.xml:


If I don’t add this dependencies, apparently Spring WS is using the JBossWS libraries as default, and these libraries can’t handle the StAX parsing/writing abilities of Spring WS.
So, after adding the necessary dependencies and redeploying the web service I got the expected response:

<soap-ENV:Envelope xmlns:SOAP-ENV="">
      <hr:HolidayResponse xmlns:hr="">
         <!--Test comment-->

I don’t know about other J(2)EE Servers but for this JBoss version you need these dependencies to get it working.


About Pascal Alma

Pascal is a senior IT consultant and has been working in IT since 1997. He is monitoring the latest development in new technologies (Mobile, Cloud, Big Data) closely and particularly interested in Java open source tool stacks, cloud related technologies like AWS and mobile development like building iOS apps with Swift. Specialties: Java/JEE/Spring Amazon AWS API/REST Big Data Continuous Delivery Swift/iOS
This entry was posted in JBoss, Spring Framework, XML/ XSD/ XSLT and tagged , . Bookmark the permalink.