Search code examples
web-servicessoapwsdlcxf

how to handle schema-less response type from Mikogo WSDL using Apache CXF


I use wsdl2java from Apache CXF to create java stubs for Mikogo Web interface.

The creation fails with the following message:

The part does not have a type defined. Every part must specify a type from
some type system. The type can be specified using the built in element or type
attributes or may be specified using an extension attribute.

The WSDL looks defines the following message:

<wsdl:message name="methodHttpPostOut">
  <wsdl:part name="Body"/>
</wsdl:message>

<http:address location=... />

This looks to me like a non-SOAP and "schema-less" response type, that is not covered by a strict XSD type definition.

  1. I am not sure, if CXF does provide such a "schema-less" definition.
  2. what is the purpose of http://schemas.xmlsoap.org/wsdl/http/ and can I make use of this kind of interface with Apache CXF

Can anyone help with that?


Solution

  • This errors you get because the your part doesn't have a type defined. You can use these message-typing attributes:

    • element. Refers to an XSD element using a QName.
    • type. Refers to an XSD simpleType or complexType using a QName.

    Here is simple example for complexType:

    <definitions .... >
        <types>
            <schema .... >
    
               <element name="Invoice" type="tns:InvoiceType"/>
               <complexType name="InvoiceType">
                   <all>
                       <element name="id" type="string"/>
                   </all>
               </complexType>
            </schema>
        </types>
    
        <message name="PO">
            <part name="invoice" element="tns:Invoice"/>
        </message>
    </definitions> 
    

    1. I think CFX doesn't support "shema-less" definitions.
    2. In this link you can find supported namespaces. This namespace provides URI attribute.

    and here some link about http namespace and wsdl's message: