java wsimport rename/different ObjectFactory.java
Asked Answered
R

1

6

I'm having problem with wsimport. In one of my wsdl which has to be wsimported I have a complexType with name "objectFactory". Is there any way to tell command wsimport to create while importing different class for maintaining JAXB connections such is ObjectFactory.java. In other words can I tell wsimport instead of creating ObjectFactory.java some custom class like MyCustomFactory.java?

Is it possible to customize mapping in such a way that complexType name="objectFactory" would map to object with different name like MyObjectFactory.java?

Thx

Rowlock answered 30/5, 2011 at 13:49 Comment(0)
M
2

JAX-WS (of which wsimport is a part) uses JAXB for generating the XML binding files (and for doing the actual binding). So you'll want to check out this documentation on customizing JAXB bindings. It applies just as well to your case.

In your case you'd 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 external configuration.

Monacid answered 31/5, 2011 at 7:44 Comment(2)
If I understand this right I need to change WSDL file and insert above sample into WSDL file? Or can I create external binding file to transform it to proper class? Example plsRowlock
Changing the WSDL is one way. Examples for specifying external configuration are found in the documentation I linked to.Monacid

© 2022 - 2024 — McMap. All rights reserved.