You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Dean Andrews <da...@guidewire.com> on 2009/12/22 01:39:25 UTC

default namespace not specified from xjc output when no package-info.java

cxf-2.2.3; jaxb 2.1.3; java 1.6

 

Was trying to see where the parameter name was being lost and the differences in wsdl for different the different xml parameters (element vs type).  

 

So created a simple xsd:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" >

    <xsd:element name="e2" type="t2">

    </xsd:element>

    <xsd:complexType name="t2">

        <xsd:sequence>

            <xsd:element name="Child"/>

        </xsd:sequence>

    </xsd:complexType>

</xsd:schema>

 

And a simple ws to access the xjc generated classes:

package test.ws.services;

…

@WebService

public class SampleXJCWS {

  @Oneway

  public void doE2(T2 el) {

    System.out.println("DoE2 = " + el);

  }

…

}

 

The captured wsdl, was invalid, xerces "Namespace URI {} not available in schema ws.samplexjc.wsdl":

<wsdl:definitions name="SampleXJCWSService" targetNamespace="http://services.ws.test/"

                  xmlns:ns1="http://schemas.xmlsoap.org/wsdl/soap/http"

                  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://services.ws.test/"

                  xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/

                  xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <wsdl:types>

        <xs:schema elementFormDefault="unqualified" targetNamespace="http://services.ws.test/" version="1.0"

                   xmlns:tns="http://services.ws.test/" xmlns:xs=http://www.w3.org/2001/XMLSchema>

…

            <xs:complexType name="doE2">

                <xs:sequence>

                    <xs:element minOccurs="0" name="arg0" type="t2"/>

                </xs:sequence>

            </xs:complexType>

…

        <xs:schema targetNamespace="http://services.ws.test/" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">

…

            <xs:complexType name="t2">

                <xs:sequence>

                    <xs:element name="Child" type="xs:anyType"/>

                </xs:sequence>

            </xs:complexType>

…

</wsdl:definitions>

 

 

This can be corrected by adding an xmlns=http://services.ws.test/ to both schema declarations.  It is not a problem if a package-info class exists.