<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: PI 7.5 REST array conversion rule with different namespaces in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/pi-7-5-rest-array-conversion-rule-with-different-namespaces/qaa-p/12409153#M4644996</link>
    <description>&lt;P&gt;Hi Petr ,&lt;/P&gt;&lt;P&gt;I don't think you can use Anonymizer bean , note in receiver channel module execution takes first then the adpater config . But in your case the prefix is added during adapter config i.e after module execution.&lt;/P&gt;&lt;P&gt;Either you have to do completely write custom module to do XML to desired json .&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Manoj&lt;/P&gt;</description>
    <pubDate>Wed, 16 Jun 2021 15:43:57 GMT</pubDate>
    <dc:creator>manoj_khavatkopp</dc:creator>
    <dc:date>2021-06-16T15:43:57Z</dc:date>
    <item>
      <title>PI 7.5 REST array conversion rule with different namespaces</title>
      <link>https://community.sap.com/t5/technology-q-a/pi-7-5-rest-array-conversion-rule-with-different-namespaces/qaq-p/12409149</link>
      <description>&lt;P&gt;Hello guys,&lt;/P&gt;
  &lt;P&gt;I'm trying to solve quite specific problem. I went through a lot of posts and KB's but I didn't found any helping result.&lt;/P&gt;
  &lt;P&gt;I have 1 node called "DATA" which must be handled in 2 different ways - in 1 node as single value, in other as array. &lt;/P&gt;
  &lt;P&gt;In attachment there is XML example, important part is that I made XML with 2 namespaces&lt;/P&gt;
  &lt;P&gt;and REST Result example how it should look like.&lt;/P&gt;
  &lt;P&gt;&lt;I&gt;&lt;A href="http://muh.com/Akeneo/SimpleTypes" target="test_blank"&gt;http://muh.com/Akeneo/SimpleTypes&lt;/A&gt; &lt;/I&gt;and &lt;STRONG&gt;&lt;EM&gt;&lt;A href="http://muh.com/Akeneo/MultiTypes" target="test_blank"&gt;http://muh.com/Akeneo/MultiTypes&lt;/A&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;XML example of the node's&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&amp;lt;ns1:data xmlns:ns1 = "http://muh.com/Akeneo/SimpleTypes"&amp;gt;C 2222&amp;lt;/ns1:data&amp;gt;   &amp;lt;!---- no table

&amp;lt;ns2:data xmlns:ns2 = "http://muh.com/Akeneo/MultiTypes"&amp;gt;A&amp;lt;/ns2:data&amp;gt;         &amp;lt;!-- must be table
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Definition of the REST Adapter&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1946859-yihw3.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Result - which I want to achieve&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;{ 
  "node1": {"data": "C 2222"},
  "node2": {"data": ["A"]}
}
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Result which I've got - &lt;STRONG&gt;ALL DATA&lt;/STRONG&gt; nodes are mapped as array in both namespaces&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;{ 
  "node1": {"data": ["C 2222"]},
  "node2": {"data": ["A"]}
}
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Question is if I understand namespaces in the REST channel correctly.&lt;/P&gt;
  &lt;P&gt;Do you have any idea if this task can be somehow solved on PI?&lt;/P&gt;
  &lt;P&gt;We have XI ADAPTER FRAMEWORK 7.50 - SP 20&lt;/P&gt;
  &lt;P&gt;Thank you very much for your help&lt;/P&gt;
  &lt;P&gt;Petr Hodbod&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 08:05:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/pi-7-5-rest-array-conversion-rule-with-different-namespaces/qaq-p/12409149</guid>
      <dc:creator>former_member305944</dc:creator>
      <dc:date>2021-06-16T08:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: PI 7.5 REST array conversion rule with different namespaces</title>
      <link>https://community.sap.com/t5/technology-q-a/pi-7-5-rest-array-conversion-rule-with-different-namespaces/qaa-p/12409150#M4644993</link>
      <description>&lt;P&gt;Hi Petr,&lt;/P&gt;&lt;P&gt;As far as i know, there is no way that we can have the same element i.e "data" in your case with one as an array and another one as an object with the rest adapter configuration.  With the config you have maintained if you enable "NameSpace mapping" with no namespace defined (Jut enable that option don't provide any namespace/json prefix in that ) you will get output like below where the prefix will be part of the element name in the JSON.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;{ 
  "node1": {"ns1.data": "C 2222"},
  "node2": {"ns2.data": ["A"]}
}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Manoj &lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 09:11:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/pi-7-5-rest-array-conversion-rule-with-different-namespaces/qaa-p/12409150#M4644993</guid>
      <dc:creator>manoj_khavatkopp</dc:creator>
      <dc:date>2021-06-16T09:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: PI 7.5 REST array conversion rule with different namespaces</title>
      <link>https://community.sap.com/t5/technology-q-a/pi-7-5-rest-array-conversion-rule-with-different-namespaces/qaa-p/12409151#M4644994</link>
      <description>&lt;P&gt;Hi Manoj&lt;/P&gt;&lt;P&gt;thanks a lot for your answer. I've thought that this is not possible.&lt;/P&gt;&lt;P&gt;Petr&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 11:13:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/pi-7-5-rest-array-conversion-rule-with-different-namespaces/qaa-p/12409151#M4644994</guid>
      <dc:creator>former_member305944</dc:creator>
      <dc:date>2021-06-16T11:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: PI 7.5 REST array conversion rule with different namespaces</title>
      <link>https://community.sap.com/t5/technology-q-a/pi-7-5-rest-array-conversion-rule-with-different-namespaces/qaa-p/12409152#M4644995</link>
      <description>&lt;P&gt;Hi Manoj,&lt;/P&gt;&lt;P&gt;I'd like to ask you 1 more question, regarding this solution. Do you think can we use some ModuleBean to remove prefixes after that conversion is done? I was thinking about XMLAnonymizer, but it brings error that these namespaces doesnot exists, which is probably correct.&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;Petr&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 14:20:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/pi-7-5-rest-array-conversion-rule-with-different-namespaces/qaa-p/12409152#M4644995</guid>
      <dc:creator>former_member305944</dc:creator>
      <dc:date>2021-06-16T14:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: PI 7.5 REST array conversion rule with different namespaces</title>
      <link>https://community.sap.com/t5/technology-q-a/pi-7-5-rest-array-conversion-rule-with-different-namespaces/qaa-p/12409153#M4644996</link>
      <description>&lt;P&gt;Hi Petr ,&lt;/P&gt;&lt;P&gt;I don't think you can use Anonymizer bean , note in receiver channel module execution takes first then the adpater config . But in your case the prefix is added during adapter config i.e after module execution.&lt;/P&gt;&lt;P&gt;Either you have to do completely write custom module to do XML to desired json .&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Manoj&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 15:43:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/pi-7-5-rest-array-conversion-rule-with-different-namespaces/qaa-p/12409153#M4644996</guid>
      <dc:creator>manoj_khavatkopp</dc:creator>
      <dc:date>2021-06-16T15:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: PI 7.5 REST array conversion rule with different namespaces</title>
      <link>https://community.sap.com/t5/technology-q-a/pi-7-5-rest-array-conversion-rule-with-different-namespaces/qaa-p/12409154#M4644997</link>
      <description>&lt;P&gt;HI Manoj,&lt;/P&gt;&lt;P&gt;Thanks a lot for that. &lt;/P&gt;&lt;P&gt;Petr&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 06:01:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/pi-7-5-rest-array-conversion-rule-with-different-namespaces/qaa-p/12409154#M4644997</guid>
      <dc:creator>former_member305944</dc:creator>
      <dc:date>2021-06-17T06:01:17Z</dc:date>
    </item>
  </channel>
</rss>

