Java wsimport rename / different ObjectFactory.java

I have a problem with wsimport . In one of my wsdl, which should be wsimport ed, I have a complexType named "objectFactory" . Is it possible to specify the wsimport command to create another class when importing to support JAXB connections, for example, ObjectFactory.java . In other words, can I say wsimport instead of creating ObjectFactory.java some custom class like MyCustomFactory.java ?

Can I customize the mapping so that complexType name="objectFactory" displays an object with a different name, for example MyObjectFactory.java ?

thanks

+4
source share
1 answer

JAX-WS (of which wsimport is part) uses JAXB to generate XML binding files (and for the actual binding). So you will want to check out this documentation on setting up JAXB bindings . This also applies to your case.

In your case, you will use something like this:

 <xsd:complexType name="objectFactory"> <xsd:annotation> <xsd:appinfo> <jxb:class name="MyObjectFactory" /> </xsd:appinfo> </xsd:annotation> <!-- ... rest of your specification ... -> </xsd:complexType> 

This example is for inline customization in your XML Schema / WSDL. You can also provide this information as an external configuration .

+2
source

All Articles