I did a little more reading up on XML schemas. It looks like elementFormDefault=”required” only applies to elements and not attributes. attributeFormDefault is what is used to specify namespace handling on attributes. If the attributeFormDefault is not specified in the <xsd:schema> element, then it defaults to attributeFormDefault=”unqualified”.
Based on that information, and the schema from the WSDL below, it does look to me like the code generated by Axis 2 is incorrectly namespace qualifying the attribute “count”.
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap..org/soap/envelope/">
<soapenv:Header />
<soapenv:Body>
<ns1:lookup xmlns:ns1="http://tempuri.org/" ns1:count="1">
<ns1:upc>1234567890</ns1:upc>
</ns1:lookup>
</soapenv:Body>
</soapenv:Envelope>
-----Original Message-----
From: Doolittle, Todd
Sent: Monday, September 11, 2006 11:38 AM
To: '[email protected]'
Subject: namespace qualified attributes
I have a vendor that is claiming that the Axis 2 client is not handling attributes correctly. The schema portion of some WSDL is shown below. When the Axis 2 client sends the message, it namespace qualifies the attribute. The vendor’s server reply with “missing attribute: count” because it does not recognize the namespace qualified attribute. When I asked them about it, they said that Axis 2 is not adhering to the WSDL contract because “The WSDL clearly say there is no namespace for count attribute.” Is this an Axis 2 problem? I thought that the elementFormDefault=”qualified” specified everything is to be namespace qualified. Does it only apply to elements? How would one specify in the WSDl that attributes should be namespace qualified?
Thanks!
Todd
<xsd:schema elementFormDefault="qualified"
targetNamespace="http://tempuri.org/"
xmlns:s1="http://tempuri.org/">
<xsd:element name="lookup">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="upc" nillable="true" type="xsd:string" />
</xsd:sequence>
<xsd:attribute name="count" type="xsd:int" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:schema>
This message, including any attachments, is the property of Sears Holdings Corporation and/or one of its subsidiaries. It is confidential and may contain proprietary or legally privileged information. If you are not the intended recipient, please delete it without reading the contents. Thank you.
