0

我在 dss 中创建了一个服务及其工作。问题是我得到的输出为:

<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>

但我希望我的输出为:

<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>

如何使用输出映射来实现这种结构?期待您的回答。提前致谢。

上面的事情做完了但是有问题吗?我的 DSS 服务为:

<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>

我的 cir_registry 表和 cir_category 表的列名 ID 相同。由于两者具有相同的名称,因此我的值每次都会被覆盖。那么如何唯一引用注册表和类别表的列ID?

4

1 回答 1

1

在 DSS 中,我们能够创建复杂的输出元素,也就是说,我们可以将信息嵌套在任意 XML 结构中,查看此 [1] 以获取更多信息。

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

干杯,安佳娜。

于 2013-05-20T07:21:32.403 回答