You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by vincent <vi...@thelis.fr> on 2006/03/27 17:26:32 UTC

'Type {http://www.opentravel.org/2005B/}AlphaLength1 is referenced but not defined.'

Hello,
I have a problem with wsdl and external xsd. I want to use xsd of OTA, =
if I include it in the wsdl no problem but if I want to use an objetc I =
have the error:
'Type {http://www.opentravel.org/2005B/}AlphaLength1 is referenced but =
not defined.'

My wsdl is:

<?xml version=3D"1.0" encoding=3D"UTF-8"?>

<wsdl:definitions targetNamespace=3D"urn:test"=20

xmlns:apachesoap=3D"http://xml.apache.org/xml-soap"=20

xmlns:impl=3D"urn:test"=20

xmlns:intf=3D"urn:test"=20

xmlns:soapenc=3D"http://schemas.xmlsoap.org/soap/encoding/"=20

xmlns:wsdl=3D"http://schemas.xmlsoap.org/wsdl/"=20

xmlns:wsdlsoap=3D"http://schemas.xmlsoap.org/wsdl/soap/"

xmlns:OTA=3D"http://www.opentravel.org/2005B/"

xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema"=20

>

<!--WSDL created by Apache Axis version: 1.3

Built on Oct 05, 2005 (05:23:37 EDT)-->


<wsdl:types>

<schema targetNamespace=3D"urn:test" =
xmlns=3D"http://www.w3.org/2001/XMLSchema">

<import namespace=3D"http://schemas.xmlsoap.org/soap/encoding/"/>


<import namespace=3D"http://www.opentravel.org/2005B/" =
schemaLocation=3D"http://www.opentravel.org/2005B/OTA_SimpleTypes.xsd"/>


<complexType name=3D"CustomerListInformation">

<sequence>

<element name=3D"address" type=3D"OTA:AlphaLength1"/>

<element name=3D"birthday" type=3D"xsd:short"/>

</sequence>

</complexType>



After this error I have an another error:

Only 1 Url-Mapping can be specified for servlet 'testServlet'





Primary I think I must add:

<java-xml-type-mapping>

<java-type>String</java-type>

<root-type-qname =
xmlns:OTA=3D"http://www.opentravel.org/2005B/">OTA:AlphaLength1</root-typ=
e-qname>

<qname-scope>simpleType</qname-scope>

</java-xml-type-mapping>

in my mappingfile but I have always the problem.=20

Thanks.

Re: 'Type {http://www.opentravel.org/2005B/}AlphaLength1 is referenced but not defined.'

Posted by Anne Thomas Manes <at...@gmail.com>.
I just looked at the schema you're importing from
http://www.opentravel.org/2005B/OTA_SimpleTypes.xsd<http://www.opentravel.org/2005B/OTA_SimpleTypes.xsd%22/>

Note that this schema does not have a targetNamespace, therefore the
elements and types defined within this schema are in no namespace. That
would explain why you're getting the "type is not defined" error.

I suggest you include the schema rather than import it. You must also set
your default namespace to null, and reference the OTA types by their local
names only.

I know that Axis 2 currently has a problem dealing with schemas with no
namespace. I'm not sure how Axis 1 will deal with it.

You might suggest to the OTA organization that they should use namespaces.

Anne

On 3/27/06, vincent <vi...@thelis.fr> wrote:
>
> Hello,
> I have a problem with wsdl and external xsd. I want to use xsd of OTA, =
> if I include it in the wsdl no problem but if I want to use an objetc I =
> have the error:
> 'Type {http://www.opentravel.org/2005B/}AlphaLength1<http://www.opentravel.org/2005B/%7DAlphaLength1>is referenced but =
> not defined.'
>
> My wsdl is:
>
> <?xml version=3D"1.0" encoding=3D"UTF-8"?>
>
> <wsdl:definitions targetNamespace=3D"urn:test"=20
>
> xmlns:apachesoap=3D"http://xml.apache.org/xml-soap"=20<http://xml.apache.org/xml-soap%22=20>
>
> xmlns:impl=3D"urn:test"=20
>
> xmlns:intf=3D"urn:test"=20
>
> xmlns:soapenc=3D"http://schemas.xmlsoap.org/soap/encoding/"=20<http://schemas.xmlsoap.org/soap/encoding/%22=20>
>
> xmlns:wsdl=3D"http://schemas.xmlsoap.org/wsdl/"=20<http://schemas.xmlsoap.org/wsdl/%22=20>
>
> xmlns:wsdlsoap=3D"http://schemas.xmlsoap.org/wsdl/soap/"
>
> xmlns:OTA=3D"http://www.opentravel.org/2005B/"
>
> xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema"=20<http://www.w3.org/2001/XMLSchema%22=20>
>
> >
>
> <!--WSDL created by Apache Axis version: 1.3
>
> Built on Oct 05, 2005 (05:23:37 EDT)-->
>
>
> <wsdl:types>
>
> <schema targetNamespace=3D"urn:test" =
> xmlns=3D"http://www.w3.org/2001/XMLSchema">
>
> <import namespace=3D"http://schemas.xmlsoap.org/soap/encoding/"/<http://schemas.xmlsoap.org/soap/encoding/%22/>
> >
>
>
> <import namespace=3D"http://www.opentravel.org/2005B/" =
> schemaLocation=3D"http://www.opentravel.org/2005B/OTA_SimpleTypes.xsd"/<http://www.opentravel.org/2005B/OTA_SimpleTypes.xsd%22/>
> >
>
>
> <complexType name=3D"CustomerListInformation">
>
> <sequence>
>
> <element name=3D"address" type=3D"OTA:AlphaLength1"/>
>
> <element name=3D"birthday" type=3D"xsd:short"/>
>
> </sequence>
>
> </complexType>
>
>
>
> After this error I have an another error:
>
> Only 1 Url-Mapping can be specified for servlet 'testServlet'
>
>
>
>
>
> Primary I think I must add:
>
> <java-xml-type-mapping>
>
> <java-type>String</java-type>
>
> <root-type-qname =
> xmlns:OTA=3D"http://www.opentravel.org/2005B/">OTA:AlphaLength1</root-typ<http://www.opentravel.org/2005B/%22%3EOTA:AlphaLength1%3C/root-typ>
> =
> e-qname>
>
> <qname-scope>simpleType</qname-scope>
>
> </java-xml-type-mapping>
>
> in my mappingfile but I have always the problem.=20
>
> Thanks.
>