Hi,

The issue is a result of JAXBContext.generateSchema(). JAXB doesn't try to derive the target namespace from the java package name and it use "" as the default unless the package is annotated with @XmlSchema.

Adding a test/server/package-info.java with the following contents allow you to provide the namespace.

@javax.xml.bind.annotation.XmlSchema(namespace="http://test/server";)
package test.server;

Then the generated schema looks like:

<?xml version="1.0" standalone="yes"?>
<xs:schema version="1.0" targetNamespace="http://test/server"; xmlns:tns="http://test/server"; xmlns:xs="http://www.w3.org/2001/XMLSchema";>

 <xs:complexType name="data">
   <xs:sequence>
<xs:element name="a" type="tns:data2" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
     <xs:element name="b" type="xs:int"/>
     <xs:element name="c" type="xs:float"/>
   </xs:sequence>
 </xs:complexType>

 <xs:complexType name="data2">
   <xs:sequence>
<xs:element name="asdf" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
   </xs:sequence>
 </xs:complexType>
</xs:schema>

Can you try to add package-info.java? I agree it is not nice at all if the default value (no namespace) breaks the generated WSDL/XSD.

Thanks,
Raymond


--------------------------------------------------
From: "Phillips, Chad" <[email protected]>
Sent: Tuesday, February 17, 2009 11:13 AM
To: <[email protected]>
Subject: Problem with generated WSDLs

Hi,

I'm having a problem when using the WSDLs generated via Tuscany SCA Java
1.4 for services using the WS binding.  Specifically, I can't generate a
WS client using Axis, Axis2, JAX-WS, or XMLBeans with the Tuscany
generated WSDL.  The issue only seems to show up when the input
parameter for a service contains a complex type.  I've documented the
issue (including code to reproduce the error) in
https://issues.apache.org/jira/browse/TUSCANY-2853

The problem seems to be related to how namespaces are being created
and/or associated with the complex types in the WSDL.  Has anyone else
encountered this issue and if so have you found a workaround to the
problem?

- Chad Phillips

Attachment: package-info.java
Description: Binary data

Reply via email to