How to define a password to wsdl in cxf-maven-plugin -


i want use cxf-maven-plugin generate java code wsdl per doc: http://cxf.apache.org/docs/maven-cxf-codegen-plugin-wsdl-to-java.html

the service trying reach password protected. how specify password? doesn't seem documented.

 <plugin>   <groupid>org.apache.cxf</groupid>   <artifactid>cxf-codegen-plugin</artifactid>   <executions>     <execution>       <id>generate-sources</id>       <phase>generate-sources</phase>       <configuration>         <sourceroot>${project.build.directory}/generated/cxf</sourceroot>         <wsdloptions>           <wsdloption>             <wsdl>http://host/theservice.wsdl</wsdl>           </wsdloption>         </wsdloptions>       </configuration>       <goals>         <goal>wsdl2java</goal>       </goals>     </execution>   </executions> </plugin> 

you can use basic auth scheme uri :

<wsdl>http://username:password@host/theservice.wsdl</wsdl> 

but if wsdl reference xsd relative path, username , password won't used loading xsd... can set authenticator globaly... need add exec plugin run class set defaut authenticator running jvm :

use http://mojo.codehaus.org/exec-maven-plugin/ , exec:java run class in same jvm codegen plugin. wsdl2java execution must happen after exec:java. run class set authenticator explain here : http://docs.oracle.com/javase/7/docs/technotes/guides/net/http-auth.html

some day, we'll have usefull -ddefault.authenticatorclass=package.to.my.authenticatorimpl jvm arg...


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -