WSIT, Maven, and wsimport -- Can They Work Together?

Posted by rtperson on Stack Overflow See other posts from Stack Overflow or by rtperson
Published on 2010-03-24T14:10:14Z Indexed on 2010/03/24 14:13 UTC
Read the original article Hit count: 538

Hi all,

I'm working on a small-ish multi-module project in Maven. We've separated the UI from the database layer using Web Services, and thanks to the jaxws-maven-plugin, the creation of the WSDL and WS client are more or less handled for us. (The plugin is essentially a wrapper around wsgen and wsimport.) So far so good.

The problem comes when I try to layer WSIT security into the picture. NetBeans allows me to generate the security metadata easily, but wsimport seems completely incapable of dealing with anything beyond a Basic-auth level of security.

Here's our current, insecure way of calling wsimport during a Maven build:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>jaxws-maven-plugin</artifactId>
    <version>1.10</version>
    <executions>
        <execution>
            <goals>
                <goal>wsimport</goal>
            </goals>
            <configuration>
                <wsdlUrls>
                    <wsdlUrl>${basedir}/../WebService/target/jaxws/wsgen/wsdl/WebService.wsdl</wsdlUrl>
                </wsdlUrls>
                <packageName>com.yourcompany.appname.ws.client</packageName>
                <sourceDestDir>${basedir}/src/main/java</sourceDestDir>
                <destDir>${basedir}/target/jaxws</destDir>
            </configuration>
        </execution>
    </executions>
</plugin>

I have tried playing around with xauthFile, xadditionalHeaders, passing javax.xml.ws.security.auth.username and password through args. I have also tried using wsimport from the command line to point to the Tomcat-generated WSDL, which has the additional security info. Nothing, however, seems to change the composition of the wsimport-generated files at all.

So I guess my question here is, to get a WSIT-compliant client, am I stuck abandoning Maven and the jaxws plugin altogether? Is there a way to get a WSIT client to auto-generate? Or will I need to generate the client by hand?

Let me know if you need any additional info beyond what I've written here. I'm deploying to Tomcat, although that doesn't seem to be an issue, as Maven seems happy to pull Metro into the deployed WAR file.

Thanks in advance!

© Stack Overflow or respective owner

Related posts about wsit

Related posts about maven-2