Generate *PortProxy.java with wsimport

734 views Asked by At

i am trying to generate the JAXWS client with Maven. For this i use the "org.jvnet.jax-ws-commons:jaxws-maven-plugin". The plugin generates all necessary files but not the *PortProxy.java.

I've tried to generate the client with the command line version of wsimport. I've used different versions of wsimport from JDK1.7.0_55 (x64), JDK1.7.0_65 (x86) and from IBM WebSphere Application Server Version 8.

The only working way to generate the *PortProxy.java file is using the Eclipse wizard. (Right click on the WSDL --> Generate --> Client --> Set the client project --> Finish.). What are the differences between the wizard and the CLI?

Thanks for your help.

1

There are 1 answers

0
rjdkolb On

I think you are looking for the wrong generated client class.

It should be something like *Service.java .

If you can't find a class like that, look for a class with something similar to this in:

static {
    URL url = null;
    WebServiceException e = null;
    try {
        url = new URL("http://localhost:8080/ws/countries.wsdl");
    } catch (MalformedURLException ex) {
        e = new WebServiceException(ex);
    }
    WORKFLOWAPIPORTSERVICE_WSDL_LOCATION = url;
    WORKFLOWAPIPORTSERVICE_EXCEPTION = e;
}

Plugin :

    <plugin>
        <groupId>org.jvnet.jax-ws-commons</groupId>
        <artifactId>jaxws-maven-plugin</artifactId>
        <version>2.3</version>
        <executions>
            <execution>
                <goals>
                    <goal>wsimport</goal>
                </goals>
                <configuration>
                    <wsdlFiles>
                        <wsdlFile>localhost_8080/ws/countries.wsdl</wsdlFile>
                    </wsdlFiles>
                    <packageName>xxx</packageName>
                    <wsdlLocation>http://localhost:8080/ws/countries.wsdl</wsdlLocation>
                    <staleFile>${project.build.directory}/jaxws/stale/countries.stale</staleFile>
                </configuration>
                <id>wsimport-generate-countries</id>
                <phase>generate-sources</phase>
            </execution>
        </executions>
        <dependencies>
            <dependency>
                <groupId>javax.xml</groupId>
                <artifactId>webservices-api</artifactId>
                <version>2.0</version>
            </dependency>
        </dependencies>
        <configuration>
            <sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir>
            <xnocompile>true</xnocompile>
            <verbose>true</verbose>
            <extension>true</extension>
            <catalog>${basedir}/src/jax-ws-catalog.xml</catalog>
        </configuration>
    </plugin>