0 Replies Latest reply on Mar 2, 2015 10:32 AM by Markus Schwarz

    Problem calling a remote web service out of SLSB

    Markus Schwarz Newbie

      Hi guys,

      in the last month I migrated my application from JBoss 4.x to JBoss Wildfly 8.1.0.FINAL. But now I have some problems calling a remote web service out of a session bean. The session bean is the client in this case.


      I'm using the jaxws-maven-plugin to create the service classes and interfaces out of an existing WSDL file.

      public class MyService extends javax.xml.ws.Service {




      public interface MyPort {




      Now I call the web service from a SLSB like this:


      public class ServiceBean {

        public void doSomething() {

        MyService service = new MyService("http://remote-server/service/doSomething", new QName("AAA", "BBB"));

        MyPort port = service.getPort(new QName("AAA", "CCC"), MyPort.class);






      In JBoss 4.x it worked very well, but now with Wildfly, there are different problems.


      The first error I saw after calling the web service was following exception:

      javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag ; expected . at [row,col,system-id]: [61,18,"http://remote-server/service/doSomething"]











      After some research I recognized that the implementation has been changed, from JAXWS RI to Apache CXF. And Apache CXF has problems with IIS web services, if chunking is not disabled.

      Because I had no clue how to configure chunking in the stateless session bean, I just tried to use the previous working implementation. Therefore I added the JAXWS-RT dependency, and yeah, its working again. Now the WAR file is about 4-4 MB bigger, because it contains all the libraries of JAXWS-RT.


      After some time I realized that there is another problem: The Java 8 metaspace is growing indefinitely. Directly after startup there are about 16.000 classes loaded. But I also saw about 1,5 Millionen loaded classes after many calls of the web service. And I have no idea what is going on there.


      So now I'm stuck, how to solve this. I have to possibilities I think:

      1. Make the web service call working with JBoss WS implementation (Apachae CXF) and disable chunking. But how can I set chunking when the first call to new MyService(...) fails.

      2. Solve the memory problem when using JAXWS-RT, but how can this be done


      I have no idea so far, so it would be great if someone has some hints for me.


      Regards, Markus