WADL grammars and root element 'response': how can I avoid naming conflicts?

30 views Asked by At

We are working with a standard tool from SAP that requires a WADL file. WADL contains several different resources and it is using representation tag with attribute "element" pointing to root element of grammars:

<grammars>
  <xs:schema attributeFormDefault="unqualified" 
             elementFormDefault="qualified"
             xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element **name="response"**>
        <xs:complexType>
(...)
</grammars> 
<resources ...
  <resource ...
    <method name="GET" id="id1">
      <doc xml:lang="en" title="title"/>
      <request/>
      <response status="200">
        <representation mediaType="application/xml;charset=UTF-8" 
                        **element="response" **
                        xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
      </response> 

We tried to create the grammar section with multiple schemas:

<xs:schema attributeFormDefault="unqualified" 
           elementFormDefault="qualified" 
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="**response**">
    (...)
  </xs:element>
</xs:schema>
<xs:schema attributeFormDefault="unqualified" 
           elementFormDefault="qualified" 
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="**response**">
    (...)
  </xs:element>
</xs:schema>

It works great when the parent node response of the resources is different. But when it is the same like in above case, it fails due to using same name parent element (in this case "response"). Is there any way to achieve it in WADL using grammars? Please, note that all resources are different but they start always with "response".

Trying to change name to different ones works, but SAP tool fails during runtime since it expects result as root response.

Thanks in advance!

0

There are 0 answers