"Attribute group must have a set of link names" when creating OTA CXF web service client

I am creating a web service client from a published WSDL using Apache CXF battery life

This WSDL was generated in XDS provided by the Open Travel Org (OTA). I'm sure this is correct, but I have added here as well.

My problem is I am getting this error message by the CXF console when using the Eclipse Kepler Create Web Service tool (using CXF runtimes 2.7.10 and java 7u71): The attribute group must be named ref set

    WSDLToJava Error: java.lang.RuntimeException: org.apache.ws.commons.schema.XmlSchemaSerializer$XmlSchemaSerializerException: Attribute group must have ref name set

    org.apache.cxf.tools.common.ToolException: java.lang.RuntimeException: 
    org.apache.ws.commons.schema.XmlSchemaSerializer$XmlSchemaSerializerException:
    Attribute group must have ref name set
        at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:420)
        at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
        at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
        at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
        at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)
    Caused by: java.lang.RuntimeException: 
    org.apache.ws.commons.schema.XmlSchemaSerializer$XmlSchemaSerializerException: 
    Attribute group must have ref name set
        at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.addSchemas(JAXBDataBinding.java:642)
        at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:443)
        at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:714)
        at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:270)
        at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:164)
        at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:412)
... 4 more
    Caused by: 
    org.apache.ws.commons.schema.XmlSchemaSerializer$XmlSchemaSerializerException: Attribute group must have ref name set
        at org.apache.ws.commons.schema.XmlSchemaSerializer.serializeAttributeGroupRef(XmlSchemaSerializer.java:562)
        at org.apache.ws.commons.schema.XmlSchemaSerializer.serializeAttributeGroup(XmlSchemaSerializer.java:523)
        at org.apache.ws.commons.schema.XmlSchemaSerializer.serializeSchemaChild(XmlSchemaSerializer.java:2406)
        at org.apache.ws.commons.schema.XmlSchemaSerializer.serializeSchemaElement(XmlSchemaSerializer.java:1659)
        at org.apache.ws.commons.schema.XmlSchemaSerializer.serializeSchema(XmlSchemaSerializer.java:132)
        at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.addSchemas(JAXBDataBinding.java:640)
... 9 more

      

Tomcat Console apper has very long directories with "Connection reset by peer: socket write error"

The WSL deployment utility is as follows:

    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions 
            name="OTA_VehAvailRateService" 
            xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" 
            xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
            xmlns:xs="http://www.w3.org/2001/XMLSchema"      

            targetNamespace="http://www.opentravel.org/OTA/2003/05"
            xmlns:ota="http://www.opentravel.org/OTA/2003/05">

        <wsdl:types>
            <xs:schema>
                <xs:import namespace="http://www.opentravel.org/OTA/2003/05" schemaLocation="OTA_VehAvailRateRQ.xsd" />
            </xs:schema>
            <xs:schema>
                <xs:import namespace="http://www.opentravel.org/OTA/2003/05" schemaLocation="OTA_VehAvailRateRS.xsd" />
            </xs:schema>        
        </wsdl:types>

      <wsdl:message name="OTA_VehAvailRateRequest"> 
        <wsdl:part element="ota:OTA_VehAvailRateRQ" name="parameters"/>
      </wsdl:message>
      <wsdl:message name="OTA_VehAvailRateResponse">
        <wsdl:part element="ota:OTA_VehAvailRateRS" name="parameters"/>
      </wsdl:message>

      <wsdl:portType name="OTA_VehAvailRatePortType">
        <wsdl:operation name="OTA_VehAvailRateAction">
          <wsdl:input message="ota:OTA_VehAvailRateRequest"/>
          <wsdl:output message="ota:OTA_VehAvailRateResponse"/>
        </wsdl:operation>
      </wsdl:portType>  

      <wsdl:binding name="OTA_VehAvailRateSOAPBinding" type="ota:OTA_VehAvailRatePortType">
        <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

        <wsdl:operation name="OTA_VehAvailRateAction">
          <soap12:operation soapAction="OTA_VehAvailRateSoapAction" style="document"/>

          <wsdl:input>
            <soap12:body use="literal"/>
          </wsdl:input>

          <wsdl:output>
            <soap12:body use="literal"/>
          </wsdl:output>

        </wsdl:operation>
      </wsdl:binding> 


      <wsdl:service name="OTA_VehAvailRateService">
        <wsdl:port name="OTA_VehAvailRatePort" binding="ota:OTA_VehAvailRateSOAPBinding">
          <soap12:address location="http://172.26.0.40:85/WebServiceAmadeus/services/OTA_VehAvailRatePort"/>
        </wsdl:port>
      </wsdl:service>   

    </wsdl:definitions>

      

UPDATE:

I don't think the reason is the schema definition, because:

  • The scheme is provided by OTA (International Standard for Web Services for Traveling Brokers).
  • If I use the local address of the same workspace to deploy the web service client, it works well. Ie:

Instead of this:

    http://172.26.0.40:85/WebServiceAmadeus/services/OTA_VehAvailRatePort?wsdl

      

I use:

    /WebServiceAmadeus/WebContent/wsdl/KarveOta.wsdl

      

Where WebServiceAmadeus is the project folder of the same workspace.

Of course, this is not a solution, because it can only work on localhost.

UPDATE

I tried with other versions of CXF (2.4.2, 3.0.2, etc.) with the same problem. I tried with SOAP version 1.1 with the same problem. From SOAP UI 5.0.0, I can expand the request, but the response says Unmarshalling Error :?

+3


source to share


3 answers


Ask the same problem with OTA. I am using spring ws and for me the problem was solved when I add

<property name="inline" value="false"/>

      



in

org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection

+1


source


This is probably a bug in your XML schema. Check if it uses an element <xs:attributeGroup>

to refer to some globally defined attribute group, and if so, if it has an attribute ref

.



0


source


I am also working with OTA2009 and I am wondering how you dealt with this problem?

I am upgrading to the latest axis2 starting from 1.5.6 to 1.7.1 and is building perfect on the old axis 1.5.6, but when I use axis 1.7.1 to build I get the error:

log4j:WARN No appenders could be found for logger (org.apache.axiom.locator.DefaultOMMetaFactoryLocator).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:294)
    at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:50)
    at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBeansExtension.java:126)
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:247)
    ... 2 more
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBeansExtension.java:115)
    ... 3 more
Caused by: java.lang.RuntimeException: org.apache.xmlbeans.XmlException: /Users/paul/env/dev/dms/workspace/crs-test-ws/OTA2009A_Publication/OTA_HotelRatePlanNotifRQ.xsd:5:1: error: Problem parsing referenced XML resource - org.xml.sax.SAXException: Attribute group must have ref name set
org.apache.ws.commons.schema.XmlSchemaException: Attribute group must have ref name set
    at org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:326)
    ... 8 more
Caused by: org.apache.xmlbeans.XmlException: /Users/paul/env/dev/dms/workspace/crs-test-ws/OTA2009A_Publication/OTA_HotelRatePlanNotifRQ.xsd:5:1: error: Problem parsing referenced XML resource - org.xml.sax.SAXException: Attribute group must have ref name set
org.apache.ws.commons.schema.XmlSchemaException: Attribute group must have ref name set
    at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:226)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667)
    at org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:190)
    ... 8 more

      

0


source







All Articles