jax-ws-api icon indicating copy to clipboard operation
jax-ws-api copied to clipboard

Issue with Endpoint.publish(...), the creation of the WSDL document and a work around solution

Open remcollier opened this issue 4 years ago • 1 comments

Hi,

Don't know if this is any use, so please feel free to ignore. I recently moved from Java 8 to Java 11 and my code stopped working... I fixed all the dependency issues and moved to metro but it still did not work as previously. The problem seems to be with the behaviour of Endpoint.publish(...) which used to deploy the service and the WSDL document. With release 2.3.3, the WSDL document was not published. Instead, I had to use the code below as a workaround:

public static void main(String[] args) throws IOException {
    Endpoint endpoint = Endpoint.create(new StockPrice());
    HttpServer server = HttpServer.create(new InetSocketAddress(8080), 5);
    server.setExecutor(Executors.newFixedThreadPool(5));
    HttpContext context = server.createContext("/quote");

    endpoint.publish(context);
    server.start();
}

Maybe this is on purpose and is now best practice, but in that case, the problem I faced was that I could not find any documentation anywhere that explained this change...

Perhaps I am doing something stupid... The dependencies I am using for my code are:

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>    

    <dependencies>
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-catalina</artifactId>
            <version>9.0.38</version>
        </dependency>
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
            <version>1.3.2</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.metro</groupId>
            <artifactId>webservices-rt</artifactId>
            <version>2.4.4</version>
        </dependency>    
        <dependency>
            <groupId>jakarta.xml.ws</groupId>
            <artifactId>jakarta.xml.ws-api</artifactId>
            <version>2.3.3</version>
        </dependency>
    </dependencies>

remcollier avatar Oct 08 '20 05:10 remcollier

and my code stopped working...

How does that code look like? What is it supposed to do? Sharing a workaround is not enough for anyone willing to look at why some arbitrary, currently unknown, code stopped working...

lukasj avatar Nov 26 '20 17:11 lukasj