Domanda

I have created a service in dss and its working. The problem is i am getting output as :

<cir_registryCollection xmlns="http://cts.falcon/cir">
 <cir_getRegistryData>
  <ID>AamProp_721</ID>
  <Description>its really tough to do this</Description>
  <ID>AamProp_721</ID>
  <SourceID>AamPublic_134</SourceID>
  <Description>its really tough to do this</Description>
  <ISO15926ReferenceURI>arya2Publication@books.com</ISO15926ReferenceURI>
  <Registry_ID>Book_112</Registry_ID>
</cir_getRegistryData>
</cir_registryCollection>

but i want my output as :

<cir_registryCollection xmlns="http://cts.falcon/cir">
     <cir_getRegistryData>
      <ID>AamProp_721</ID>
      <Description>its really tough to do this</Description>
</cir_getRegistryData>
<cir_getCategoryData>
<ID>AamProp_721</ID>
      <SourceID>AamPublic_134</SourceID>
      <Description>its really tough to do this</Description>
      <ISO15926ReferenceURI>arya2Publication@books.com</ISO15926ReferenceURI>
      <Registry_ID>Book_112</Registry_ID>
</cir_getCategoryData>
        </cir_registryCollection>

how to achieve this structure using output mapping? looking forward to your answers. Thanks in advance.

The above thing is done but there is a problem? I have my DSS Service as:

<data name="cir_GetAllRegistry_DataService" serviceNamespace="http://cts.falcon/cir">
   <description>select all data from all tables                          &#13;                                &#13;                                &#13;                                &#13;                                &#13;                                &#13;                                </description>
   <config id="Cir_DataSource">
      <property name="carbon_datasource_name">CIR_MySQL_DB</property>
   </config>
   <query id="select_all_cir_table_query" useConfig="Cir_DataSource">
      <sql>select r.ID,r.Description,c.ID,c.SourceID,c.Description,c.ISO15926ReferenceURI,c.Registry_ID from cir_registry r join cir_category c&#13;on r.ID=c.Registry_ID;</sql>
      <result element="Entries" rowName="Entry">
         <element column="ID" name="ID" xsdType="string"/>
         <element column="Description" name="Description" xsdType="string"/>
         <element column="ID" name="ID" xsdType="string"/>
         <element column="SourceID" name="SourceID" xsdType="string"/>
         <element column="Description" name="Description" xsdType="string"/>
         <element column="ISO15926ReferenceURI" name="ISO15926ReferenceURI" xsdType="string"/>
         <element column="Registry_ID" name="Registry_ID" xsdType="string"/>
      </result>
   </query>
   <operation name="select_all_cir_table_operation">
      <description>selects all table data in case of no data passed                              &#13;                                    </description>
      <call-query href="select_all_cir_table_query"/>
   </operation>
</data>

I have the column name ID same for table cir_registry as well as cir_category table. Since both have same name, my value everytime gets overwritten. so how to refrence the column ID of registry and category table uniquely?

È stato utile?

Soluzione

In DSS, we have the ability to create complex output elements, that is, we can nest the information with any arbitrary XML structure, check this [1] for more information.

[1] http://docs.wso2.org/wiki/display/DSS301/Complex+Elements

Cheers, Anjana.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top