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 Venkat Gyambavantha <vg...@tibco.com> on 2006/05/29 22:00:51 UTC
Namespace Issue
Hi,
Looks like there is some problem in the way namespaces are handled. Here
is the summary of the issue.
I created an xsd file that contains two complex types A and B. In the
complex type B, I create an element of type A. elementFormdefault
attribute is set to false.
Inside my wsdl, I import this xsd file
Where ns1=http://sample.com/test
<xsd:complexType name="A">
<xsd:sequence>
<xsd:element name="name"
type="xsd:string"></xsd:element>
<xsd:element name="description"
type="xsd:string"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="B">
<xsd:sequence>
<xsd:element name="resource"
type="ns1:A"
minOccurs="1" maxOccurs="1">
</xsd:element>
<xsd:element name="details"
type="xsd:string" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
When I try to create an element BElement of type B, I was expecting
output to be
Response: 1 [correct]
< BElement xmlns="http://sample.com/test">
<resource xmlns="">
<name>Test</name>
< description>desc</description>
</ resource >
<details xmlns="">some details</details>
</ BElement>
Instead the ouput looks like
Response: 2 [wrong]
< BElement xmlns="http://sample.com/test">
<resource>
<name>Test</name>
< description>desc</description>
</ resource >
<details>some details</details>
</ BElement>
Since elementFormDefault attribute is set to false, all locally defined
elements [resource, details] should belong to empty namespace. If
debugged through the code while constructing the response everything
looks fine, but the actual response I get (confirmed with the
SOAPMonitor utilty] looks like Response: 2 above.
Let me know if I am missing something.
Thanks
Venkat