[xml] can I construct an element with "local unqualified names" ?



I am trying to construct a SOAP 1.1 Response and instead of this

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
  <SOAP-ENV:Header/>
  <SOAP-ENV:Body>
    <SOAP-ENV:keha xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="xsd:array[3]" SOAP-ENC:offset="[0]">
      <SOAP-ENV:item xsi:type="xsd:string">a</SOAP-ENV:item>
      <SOAP-ENV:item xsi:type="xsd:string">b</SOAP-ENV:item>
      <SOAP-ENV:item xsi:type="xsd:string">c</SOAP-ENV:item>
    </SOAP-ENV:keha>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I'd like to get this:

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
  <SOAP-ENV:Header/>
  <SOAP-ENV:Body>
    <keha xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:array[3]"
SOAP-ENC:offset="[0]">
      <item xsi:type="xsd:string">a</item>
      <item xsi:type="xsd:string">b</item>
      <item xsi:type="xsd:string">c</item>
    </keha>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

i.e. no SOAP-ENV: in <keha> when serializing

I need this in order to be compliant with SOAP 1.1 spec serialization
rules 5.1 which state in "rules for serialization", p4 that "Accessors
whose names are local to their containing types have unqualified element
names, all others have qualified names "

I'm doing this construction from python bindings, and I _do_ give these
inner elements namespace None.

---------------------
Hannu










[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]