Search code examples
web-servicessoapjax-wsglassfish-3

Glassfish v3 + SOAP, Existing WebService not launching


I didn't make the code, I'm just being asked to help find the problem. I know nothing of SOAP.

A WebService, generated from a WSDL, is running on an old Glassfish v2.

No problem, the service is exposed on both the portName and serviceName endpoints.

Then that application is moved to Glassfish v3. Now only the portName endpoint is accessible. The serviceName is not.

Does anyone have a 5-6 step guide on fixing this. I am not in the mood to wade thorough another 50 page Oracle document, promising to help fix problems, and then ... doesn't. I've waded through the net, in wain for too long, and are quite frankly at my wits end.


Solution

  • In the implementing SOAP class, add wsdlLocation to the @WebService annotation. Remove the sun-web.xml and sun-jaxws.xml, as well as removing the listener com.sun.xml.ws.transport.http.servlet.WSServletContextListener from the web.xml. Finally adding a basic glassfish-web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
    <glassfish-web-app error-url="">
      <context-root>/</context-root>
      <class-loader delegate="true"/>
      <jsp-config>
        <property name="keepgenerated" value="true">
          <description>Keep a copy of the generated servlet class' java code.</description>
        </property>
      </jsp-config>
    </glassfish-web-app>
    

    After that, the server now locates the services itself, and places them where the WebService annotation specifies it.