You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Zmuda, Matt" <Ma...@td.com> on 2014/02/10 21:28:29 UTC

wsimport - catalog

Hi All,

I am trying to generate some web service client code from a WSDL and schemas that I have.
One issue I am encountering is that one schema file (xsd) I require is in a separate jar that my client project has a dependency on.
I cannot figure out how to reference that file in my pom. I have been lead down the path of looking into defining a catalog (and it seems that how it was done in the and build we use to use) however I can't get this working.

Below is what I have.. but not sure if I am on right track or not. Any help is appreciated!

The POM Sample

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
                <modelVersion>4.0.0</modelVersion>
                <groupId>com.thegroup</groupId>
                <artifactId>com.theclientcode</artifactId>
                <version>0.0.1-SNAPSHOT</version>

                <dependencies>
                                <dependency>
                                                <!-- This dependency contains the schema my wsdl needs -->
                                                <!-- How can I reference it? -->
                                                <groupId>com.mygroup</groupId>
                                                <artifactId>myartifact</artifactId>
                                                <version>1.0</version>
                                </dependency>
                </dependencies>
                <build>
                                <plugins>
                                                <plugin>
                                                                <groupId>org.codehaus.mojo</groupId>
                                                                <artifactId>jaxws-maven-plugin</artifactId>
                                                                <version>1.12</version>
                                                                <executions>
                                                                                <execution>
                                                                                                <goals>
                                                                                                                <goal>wsimport</goal>
                                                                                                </goals>
                                                                                </execution>
                                                                </executions>
                                                                <configuration>
                                                                                <extension>true</extension>
                                                                                <!-- Is this what I should be using? What should be in it??? 0-->
                                                                                <catalog>${basedir}/src/main/resources/META-INF/catalog.xml</catalog>
                                                                                <wsdlDirectory>${basedir}/src/main/resources</wsdlDirectory>
                                                                                <sourceDestDir>${project.build.sourceDirectory}</sourceDestDir>
                                                                                <staleFile>${basedir}/src/jaxws/stale/.staleFlag</staleFile>
                                                                                <wsdlLocation>/META-INF/wsdl/TheWSDL.wsdl</wsdlLocation>
                                                                                <wsdlFiles>
                                                                                                <wsdlFile>/META-INF/wsdl/TheWSDL.wsdl</wsdlFile>
                                                                                </wsdlFiles>
                                                                                <target>2.1</target>

                                                                </configuration>
                                                                <dependencies>
                                                                                <dependency>
                                                                                                <groupId>com.sun.xml.ws</groupId>
                                                                                                <artifactId>jaxws-tools</artifactId>
                                                                                                <version>2.2.0.2</version>
                                                                                </dependency>
                                                                </dependencies>
                                                </plugin>
                                </plugins>
                </build>
</project>


The catalog.xml Sample:

<xmlcatalog id="wsimportcatalog">
                <!--  What is this location relative to? -->
                <entity publicid="file:/com/something/Fault.xsd" location="/../schema/com/something/Fault.xsd"/>
</xmlcatalog>


Jaxb Bindings for the schema:

<jxb:bindings version="1.0"
               xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
               xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
               xmlns:xs="http://www.w3.org/2001/XMLSchema">

                <jxb:bindings schemaLocation="/com/something/Fault.xsd" node="/xs:schema">
                    <jxb:schemaBindings>
                      <jxb:package name="com.something.xml">
                        <jxb:javadoc><![CDATA[<body>Package level documentation for generated package</body>]]></jxb:javadoc>
                      </jxb:package>
                    </jxb:schemaBindings>
                </jxb:bindings>

</jxb:bindings>



NOTICE: Confidential message which may be privileged. Unauthorized use/disclosure prohibited. If received in error, please go to www.td.com/legal for instructions.
AVIS : Message confidentiel dont le contenu peut être privilégié. Utilisation/divulgation interdites sans permission. Si reçu par erreur, prière d'aller au www.td.com/francais/avis_juridique pour des instructions.

Re: wsimport - catalog

Posted by Michael Osipov <mi...@apache.org>.
Am 2014-02-18 06:48, schrieb Sartaj Hundal:
> You need to "get" the XSD that is 'in' the jar file and then reference that
> retrieval within the XML.
>
> http://stackoverflow.com/questions/9280226/referencing-a-xsd-schema-within-jar-file

This is what I wrote more than a week ago.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: wsimport - catalog

Posted by Sartaj Hundal <ve...@gmail.com>.
You need to "get" the XSD that is 'in' the jar file and then reference that
retrieval within the XML.

http://stackoverflow.com/questions/9280226/referencing-a-xsd-schema-within-jar-file

Best
Sartaj


On Mon, Feb 10, 2014 at 1:28 PM, Zmuda, Matt <Ma...@td.com> wrote:

> Hi All,
>
> I am trying to generate some web service client code from a WSDL and
> schemas that I have.
> One issue I am encountering is that one schema file (xsd) I require is in
> a separate jar that my client project has a dependency on.
> I cannot figure out how to reference that file in my pom. I have been lead
> down the path of looking into defining a catalog (and it seems that how it
> was done in the and build we use to use) however I can't get this working.
>
> Below is what I have.. but not sure if I am on right track or not. Any
> help is appreciated!
>
> The POM Sample
>
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
> http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>                 <modelVersion>4.0.0</modelVersion>
>                 <groupId>com.thegroup</groupId>
>                 <artifactId>com.theclientcode</artifactId>
>                 <version>0.0.1-SNAPSHOT</version>
>
>                 <dependencies>
>                                 <dependency>
>                                                 <!-- This dependency
> contains the schema my wsdl needs -->
>                                                 <!-- How can I reference
> it? -->
>
> <groupId>com.mygroup</groupId>
>
> <artifactId>myartifact</artifactId>
>                                                 <version>1.0</version>
>                                 </dependency>
>                 </dependencies>
>                 <build>
>                                 <plugins>
>                                                 <plugin>
>
> <groupId>org.codehaus.mojo</groupId>
>
> <artifactId>jaxws-maven-plugin</artifactId>
>
> <version>1.12</version>
>
> <executions>
>
>       <execution>
>
>                       <goals>
>
>                                       <goal>wsimport</goal>
>
>                       </goals>
>
>       </execution>
>
> </executions>
>
> <configuration>
>
>       <extension>true</extension>
>
>       <!-- Is this what I should be using? What should be in it??? 0-->
>
>       <catalog>${basedir}/src/main/resources/META-INF/catalog.xml</catalog>
>
>       <wsdlDirectory>${basedir}/src/main/resources</wsdlDirectory>
>
>       <sourceDestDir>${project.build.sourceDirectory}</sourceDestDir>
>
>       <staleFile>${basedir}/src/jaxws/stale/.staleFlag</staleFile>
>
>       <wsdlLocation>/META-INF/wsdl/TheWSDL.wsdl</wsdlLocation>
>
>       <wsdlFiles>
>
>                       <wsdlFile>/META-INF/wsdl/TheWSDL.wsdl</wsdlFile>
>
>       </wsdlFiles>
>
>       <target>2.1</target>
>
>
> </configuration>
>
> <dependencies>
>
>       <dependency>
>
>                       <groupId>com.sun.xml.ws</groupId>
>
>                       <artifactId>jaxws-tools</artifactId>
>
>                       <version>2.2.0.2</version>
>
>       </dependency>
>
> </dependencies>
>                                                 </plugin>
>                                 </plugins>
>                 </build>
> </project>
>
>
> The catalog.xml Sample:
>
> <xmlcatalog id="wsimportcatalog">
>                 <!--  What is this location relative to? -->
>                 <entity publicid="file:/com/something/Fault.xsd"
> location="/../schema/com/something/Fault.xsd"/>
> </xmlcatalog>
>
>
> Jaxb Bindings for the schema:
>
> <jxb:bindings version="1.0"
>                xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
>                xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
>                xmlns:xs="http://www.w3.org/2001/XMLSchema">
>
>                 <jxb:bindings schemaLocation="/com/something/Fault.xsd"
> node="/xs:schema">
>                     <jxb:schemaBindings>
>                       <jxb:package name="com.something.xml">
>                         <jxb:javadoc><![CDATA[<body>Package level
> documentation for generated package</body>]]></jxb:javadoc>
>                       </jxb:package>
>                     </jxb:schemaBindings>
>                 </jxb:bindings>
>
> </jxb:bindings>
>
>
>
> NOTICE: Confidential message which may be privileged. Unauthorized
> use/disclosure prohibited. If received in error, please go to
> www.td.com/legal for instructions.
> AVIS : Message confidentiel dont le contenu peut être privilégié.
> Utilisation/divulgation interdites sans permission. Si reçu par erreur,
> prière d'aller au www.td.com/francais/avis_juridique pour des
> instructions.
>

Re: wsimport - catalog

Posted by Michael Osipov <mi...@apache.org>.
Am 2014-02-10 21:28, schrieb Zmuda, Matt:
> Hi All,
>
> I am trying to generate some web service client code from a WSDL and schemas that I have.
> One issue I am encountering is that one schema file (xsd) I require is in a separate jar that my client project has a dependency on.
> I cannot figure out how to reference that file in my pom. I have been lead down the path of looking into defining a catalog (and it seems that how it was done in the and build we use to use) however I can't get this working.

That is not a Maven problem but simply a configuration problem with the 
JAX-WS Maven Plugin.

In this case, you should work like this:

Parent
|- JAR with generated classes from the XSD with generated episode file
|- JAR with SEI and provided episode file, wsimport won't duplicate the 
model in that case.

Generally, the JAX-WS Plugin has a few shortcomings compared to the JAXB 
plugin. Search the JAX_WS_COMMONS JIRA and you'll find the tickets.

Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: wsimport - catalog

Posted by Ron Wheeler <rw...@artifact-software.com>.
jaxws-maven-plugin - is there a forum for this plug-in? You might get someone there who knows.
It is not a Maven question.


Ron

On 10/02/2014 3:28 PM, Zmuda, Matt wrote:
> Hi All,
>
> I am trying to generate some web service client code from a WSDL and schemas that I have.
> One issue I am encountering is that one schema file (xsd) I require is in a separate jar that my client project has a dependency on.
> I cannot figure out how to reference that file in my pom. I have been lead down the path of looking into defining a catalog (and it seems that how it was done in the and build we use to use) however I can't get this working.
>
> Below is what I have.. but not sure if I am on right track or not. Any help is appreciated!
>
> The POM Sample
>
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
>                  <modelVersion>4.0.0</modelVersion>
>                  <groupId>com.thegroup</groupId>
>                  <artifactId>com.theclientcode</artifactId>
>                  <version>0.0.1-SNAPSHOT</version>
>
>                  <dependencies>
>                                  <dependency>
>                                                  <!-- This dependency contains the schema my wsdl needs -->
>                                                  <!-- How can I reference it? -->
>                                                  <groupId>com.mygroup</groupId>
>                                                  <artifactId>myartifact</artifactId>
>                                                  <version>1.0</version>
>                                  </dependency>
>                  </dependencies>
>                  <build>
>                                  <plugins>
>                                                  <plugin>
>                                                                  <groupId>org.codehaus.mojo</groupId>
>                                                                  <artifactId>jaxws-maven-plugin</artifactId>
>                                                                  <version>1.12</version>
>                                                                  <executions>
>                                                                                  <execution>
>                                                                                                  <goals>
>                                                                                                                  <goal>wsimport</goal>
>                                                                                                  </goals>
>                                                                                  </execution>
>                                                                  </executions>
>                                                                  <configuration>
>                                                                                  <extension>true</extension>
>                                                                                  <!-- Is this what I should be using? What should be in it??? 0-->
>                                                                                  <catalog>${basedir}/src/main/resources/META-INF/catalog.xml</catalog>
>                                                                                  <wsdlDirectory>${basedir}/src/main/resources</wsdlDirectory>
>                                                                                  <sourceDestDir>${project.build.sourceDirectory}</sourceDestDir>
>                                                                                  <staleFile>${basedir}/src/jaxws/stale/.staleFlag</staleFile>
>                                                                                  <wsdlLocation>/META-INF/wsdl/TheWSDL.wsdl</wsdlLocation>
>                                                                                  <wsdlFiles>
>                                                                                                  <wsdlFile>/META-INF/wsdl/TheWSDL.wsdl</wsdlFile>
>                                                                                  </wsdlFiles>
>                                                                                  <target>2.1</target>
>
>                                                                  </configuration>
>                                                                  <dependencies>
>                                                                                  <dependency>
>                                                                                                  <groupId>com.sun.xml.ws</groupId>
>                                                                                                  <artifactId>jaxws-tools</artifactId>
>                                                                                                  <version>2.2.0.2</version>
>                                                                                  </dependency>
>                                                                  </dependencies>
>                                                  </plugin>
>                                  </plugins>
>                  </build>
> </project>
>
>
> The catalog.xml Sample:
>
> <xmlcatalog id="wsimportcatalog">
>                  <!--  What is this location relative to? -->
>                  <entity publicid="file:/com/something/Fault.xsd" location="/../schema/com/something/Fault.xsd"/>
> </xmlcatalog>
>
>
> Jaxb Bindings for the schema:
>
> <jxb:bindings version="1.0"
>                 xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
>                 xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
>                 xmlns:xs="http://www.w3.org/2001/XMLSchema">
>
>                  <jxb:bindings schemaLocation="/com/something/Fault.xsd" node="/xs:schema">
>                      <jxb:schemaBindings>
>                        <jxb:package name="com.something.xml">
>                          <jxb:javadoc><![CDATA[<body>Package level documentation for generated package</body>]]></jxb:javadoc>
>                        </jxb:package>
>                      </jxb:schemaBindings>
>                  </jxb:bindings>
>
> </jxb:bindings>
>
>
>
> NOTICE: Confidential message which may be privileged. Unauthorized use/disclosure prohibited. If received in error, please go to www.td.com/legal for instructions.
> AVIS : Message confidentiel dont le contenu peut être privilégié. Utilisation/divulgation interdites sans permission. Si reçu par erreur, prière d'aller au www.td.com/francais/avis_juridique pour des instructions.
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org