If I'm not mistaking, when the schema elementFormDefault is set to qualified this only means that the global element declarations (i.e. those that are direct children of the schema element) should be namespace qualified. The local declarations (defined inside other elements or complexTypes) default back to not qualified. So unless the local elements specifically have the form="qualified" attribute declared on them, they are not namespace qualified. I've noticed that Axis handles this by 'unsetting' the namespace on local elements, like this:
<A xmlns="http://some.namespace.uri"> <B xmlns=""> ... </B> </A> I've also noticed that some tools don't like these kinds of XMLs. In my case I solved it by explicitly setting the form="qualfied" on my local declarations too. Hope this helps... Jan On 5/24/05, Mark Ford <[EMAIL PROTECTED]> wrote: > In my application, I am deserializing the incoming RPC encoded messages into > a DOM and then validating the DOM against the schema. I'm not using any > generated code in this process, rather I register a custom deserializer to > handle complex types and produce a Document. > > My problem is that validation fails in cases where the elementFormDefault > for the schema is set to qualified. This requires that all child elements of > a given element have the same namespace as their parent. The messages that I > receive from axis generated drivers do not provide any namespace information > for the multiRef elements. > > Here's the output from the soap monitor: > > <soapenv:Envelope > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > <soapenv:Body> > <test > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> > <datain href="#id0"/> > </test> > <multiRef id="id0" soapenc:root="0" > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > xsi:type="ns1:DocumentDataIn" > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" > xmlns:ns1="http://www.active-endpoints.com/wsdl/unit_complex_return"> > <data1 href="#id1"/> > <data2 href="#id2"/> > </multiRef> > <multiRef id="id2" soapenc:root="0" > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > xsi:type="xsd:float" > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">123.45</multiRef> > <multiRef id="id1" soapenc:root="0" > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > xsi:type="xsd:int" > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">10</multiRef> > </soapenv:Body> > </soapenv:Envelope> > > The resulting DOM looks like this: > > <datain> > <data1>10</data1> > <data2>123.45</data2> > </datain> > > But it should look like this: > > <datain > xmlns:ns1="http://www.active-endpoints.com/wsdl/unit_complex_return"> > <ns1:data1>10</ns1:data1> > <ns1:data2>123.45</ns1:data2> > </datain> > > It seems to me that the inbound message is wrong since there is no way to > convey to the receiver that data1 and data2 are qualified. The SOAP 1.1 spec > clearly states that the accessor elements that contain the href should not > be namespace qualified but it also has an example that shows a namespace > prefix being used in the multifRef encoding element > (http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383520). The > SerializationContext in axis uses the same QName for multiRefs and it has > the empty namespace. It seems like there should be a way for the multiRef > element to have a namespace prefix. > > My workaround is to have my custom deserializer check the type of each > element that I'm deserializing to see if it has a form="qualified" in the > schema or if the schema's elementFormDefault="qualified". > > I would appreciate any suggestions or other feedback, thanks. > >
