users@jaxb.java.net

Problem generating classes from schema - xjc

From: Inma Marín López <cinmaml_at_hotmail.com>
Date: Tue, 5 Oct 2010 16:44:18 +0000

Hello,

 

I developed a web service with an old version of JDeveloper some time ago, but now I have to migrate it to CXF. The WSDL uses elements from an schema (as operation parameters), but in the implementation the type of the parameters are org.w3c.dom.Element (that is because of the JDeveloper version used then).
 
When I try to generate the service skeleton (using the same WSDL that the old web service has) using WSDL2Java tool from CXF (which uses JABX for generating classes from schema elements), classes from the schema are generated, and the web service operations have parameters of these classes (classes from the schema).
 
So I have tried to generate operation parameters (elements from the used schema) as DOM objects, by xjc tool (indicating -b parameter).
 
Then, I have run the following command:
 
>xjc -b binding.xjb -d oasisxsd -p oasis.dss.core.schema dss-v1.0-core-schema-cd-03.xsd
 
where the binding file is (binding.xjc):
 
<jxb:bindings version="1.0"
              xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
              xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <jxb:bindings schemaLocation="dss-v1.0-core-schema-cd-r03.xsd"
          node="//xs:element[@name='SignRequest']">
             <jxb:dom/>
    </jxb:bindings>
</jxb:bindings>
 
(In order to try it, I have only included one element)
 
However, I get the following error:
 
[ERROR] compiler was unable to honor this dom customization. It is attached to a wrong place, or its inconsistent with other bindings.
  line 7 of file:/C:/Programacion/jaxb/jaxb-ri-20090708/jaxb-ri-20090708/lib/binding2.xjb
[ERROR] (the above customization is attached to the following location in the schema)
  line 252 of file:/C:/Programacion/jaxb/jaxb-ri-20090708/jaxb-ri-20090708/lib/dss-v1.0-core-schema-cd-r03.xsd
Failed to parse a schema.
 

The fact is that the element 'SignRequest' is of a complex type which includes several elements... could this be the problem? Or is it something wrong in my binding file?
 

Can you be so kind as to help me, please?

 

Thank you very much in advance.

 

Regards,

Inma.