<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Methma Samaranayake on Medium]]></title>
        <description><![CDATA[Stories by Methma Samaranayake on Medium]]></description>
        <link>https://medium.com/@methmas?source=rss-8f19cbec3710------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*x5tOdiaUgRaHlvgXCvKeIA.jpeg</url>
            <title>Stories by Methma Samaranayake on Medium</title>
            <link>https://medium.com/@methmas?source=rss-8f19cbec3710------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 16:31:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@methmas/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Mask Sensitive Information in WSO2 Micro Integrator (MI)]]></title>
            <link>https://medium.com/@methmas/how-to-mask-sensitive-information-in-wso2-micro-integrator-mi-78b8c923e6f4?source=rss-8f19cbec3710------2</link>
            <guid isPermaLink="false">https://medium.com/p/78b8c923e6f4</guid>
            <dc:creator><![CDATA[Methma Samaranayake]]></dc:creator>
            <pubDate>Tue, 19 Aug 2025 03:21:27 GMT</pubDate>
            <atom:updated>2025-08-19T03:21:27.994Z</atom:updated>
            <content:encoded><![CDATA[<p>When working with sensitive data, such as account numbers and IBANs, in WSO2 Micro Integrator (MI), it’s critical to ensure that these values don’t end up in your logs. In this post, I’ll walk you through the steps I followed to <strong>successfully enable log masking</strong> in <strong>WSO2 MI 4.1.0</strong>, using a real test case with a sample API.</p><p>✅ Why Log Masking Matters</p><p>Log files are invaluable during development and debugging, but they’re also a common leakage point for sensitive information. If you’re logging raw request payloads or internal properties like credit card numbers, IBANs, or tokens, a misconfigured log can become a security risk.</p><p>Fortunately, WSO2 MI supports log masking with just a few configuration tweaks.</p><h4><strong>🔧 Use Case using IBANs</strong></h4><p>Here’s the sample API I used to test IBAN masking in logs:</p><pre>&lt;api xmlns=&quot;http://ws.apache.org/ns/synapse&quot; name=&quot;PrintIbanAPI&quot; context=&quot;/iban&quot;&gt;<br>    &lt;resource methods=&quot;POST&quot; uri-template=&quot;/log&quot;&gt;<br>        &lt;inSequence&gt;<br>            &lt;property name=&quot;iban&quot; expression=&quot;json-eval($.iban)&quot; scope=&quot;default&quot;/&gt;<br>            &lt;log level=&quot;custom&quot;&gt;<br>                &lt;property name=&quot;Received IBAN&quot; expression=&quot;get-property(&#39;iban&#39;)&quot;/&gt;<br>            &lt;/log&gt;<br>            &lt;payloadFactory media-type=&quot;json&quot;&gt;<br>                &lt;format&gt;{&quot;message&quot;: &quot;IBAN received&quot;}&lt;/format&gt;<br>                &lt;args/&gt;<br>            &lt;/payloadFactory&gt;<br>            &lt;respond/&gt;<br>        &lt;/inSequence&gt;<br>    &lt;/resource&gt;<br>&lt;/api&gt;</pre><p>Sample Request:</p><pre>curl -X POST http://localhost:8290/iban/log \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;iban&quot;: &quot;ES1234567890123456789012&quot;}&#39;</pre><p>Output Observed:</p><pre>Console: INFO {LogMediator} - {api:PrintIbanAPI} Received IBAN = *****<br>Log File: INFO {org.apache.synapse.mediators.builtin.LogMediator} - {api:PrintIbanAPI} Received IBAN = *****</pre><h4><strong>🛠️ Configuration Steps</strong></h4><ol><li>Update log4j2.properties in &lt;MI_HOME&gt;/confwith additional m after %m in both CONSOLE and LOGFILE layout pattern entries.</li></ol><pre>appender.CARBON_CONSOLE.layout.pattern = [%d] %5p {%c{1}} - %mm%ex%n<br>appender.CARBON_LOGFILE.layout.pattern  = [%d] %5p {%c} - %mm%ex%n</pre><p>2. Enable Masking in deployment.toml</p><pre>[logging]<br>enable_log_masking = true<br><br>[masking_pattern.properties]<br>&quot;IBAN&quot; = &#39;[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}&#39;</pre><p>3. Add Pattern to wso2-log-masking.properties</p><pre>IBAN=[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}</pre><p>This ensures the masking engine recognises the pattern and applies it correctly.</p><p>4. Restart the Server to apply the changes.</p><h4>🧪 Test It Yourself</h4><p>Once everything is set up, send a test request similar to the curl command above and verify that the sensitive information is no longer shown in the logs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78b8c923e6f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configure On-Prem Analytics (MI Analytics) for WSO2 Micro Integrator 4.1.0/4.2.0]]></title>
            <link>https://medium.com/@methmas/configure-on-prem-analytics-mi-analytics-for-wso2-micro-integrator-4-1-0-a1062796f799?source=rss-8f19cbec3710------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1062796f799</guid>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[mi-analytics]]></category>
            <category><![CDATA[wso2-micro-integrator]]></category>
            <category><![CDATA[wso2-mi]]></category>
            <category><![CDATA[wso2-ei-analytics]]></category>
            <dc:creator><![CDATA[Methma Samaranayake]]></dc:creator>
            <pubDate>Mon, 20 Mar 2023 17:24:14 GMT</pubDate>
            <atom:updated>2023-08-09T13:29:42.553Z</atom:updated>
            <content:encoded><![CDATA[<p>WSO2 offers a comprehensive analytics solution that can cater to your needs in the Micro Integrator. The analytics solution for WSO2 MI 4.1.0 is no different from the solution provided for WSO2 EI 7.x series, which was the on-prem EI Analytics. You can use the same guide to configure MI Analytics with MI 4.2.0.</p><p>The EI Analytics distribution can be downloaded from the product page as guided in the official documentation [1]. Here onwards, I’ll continue the EI Analytics 7.1.0 as MI Analytics.</p><p>WSO2’s MI Analytics solution is comprised of two main components — “Server” and “Portal.” The server component processes the data streams sent from the Micro Integrator and publishes the statistics to a database. Meanwhile, the portal component reads the statistics published by the server and displays the data in a visually appealing format. The server and portal components are connected through the database.</p><p>Before everything, please make sure, the system is having adequate resources to run three servers (Analytics server, Analytics portal, MI). The minimum system requirements can be found in the official documentation [2].</p><p>Let’s see how we can configure WSO2 MI Analytics. I will be summarizing the required configurations in both Micro Integrator and the EI analytics sides.</p><p><strong>Step 1: Configure Micro Integrator (MI)</strong></p><p>1.1. Enable statistics monitoring — Open the &lt;MI_HOME&gt;/conf/deployment.toml file and add the below configurations under the [mediation] section.</p><pre>[mediation]<br>flow.statistics.enable=true<br>stat.tracer.collect_payloads=true<br>stat.tracer.collect_mediation_properties=true</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9a-ROI_9WE1TFbUHfgiFFQ.png" /></figure><p>1.2. Enable data publishing to MI Analytics. These configurations also have to do in the &lt;MI_HOME&gt;/conf/deployment.toml file under the [monitoring] section.</p><pre>[monitoring]<br>ei_analytics.server_url = &quot;tcp://localhost:7612&quot;<br>ei_analytics.auth_server_url = &quot;ssl://localhost:7712&quot;<br>ei_analytics.username = &quot;admin&quot;<br>ei_analytics.password = &quot;admin&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e1cymmMBLby_Efn05T7DCQ.png" /></figure><ol><li>3. We can enable statistics per artefact level if required. Please follow the official documentation for additional information on doing that [4].</li></ol><p>If you want to collect statistics for <strong>all</strong> your integration artefacts, you can add the parameter under the [mediation] section of the deployment.toml file of MI.</p><pre>flow.statistics.capture_all=true</pre><p>In addition to the above configs, please add the below configurations in the &lt;MI_HOME&gt;/conf/deployment.toml file for MI 4.2.0 version.</p><pre>[analytics]<br>enabled = true<br>publisher = &quot;databridge&quot;</pre><p>1.4. Save the changes.</p><p><strong>Step 2: Configure Micro Integrator Analytics (MI Analytics)</strong></p><p>2.1 Configure the MI Analytics ‘Server’.</p><p>2.1.1. Open the &lt;MI_ANALYTICS&gt;/conf/server/deployment.yaml file</p><p>2.1.2. Edit the EI_ANALYTICS section which is the main database used in MI Analytics aggregations. Following is a sample for MySQL.</p><pre># EI Analytics data source<br>   - name: EI_ANALYTICS<br>     description: &quot;The datasource used for EI Analytics dashboard feature&quot;<br>     jndiConfig:<br>       name: jdbc/EI_ANALYTICS<br>     definition:<br>       type: RDBMS<br>       configuration:<br>         jdbcUrl: &#39;jdbc:mysql://localhost:3306/ei_analytics_db&#39;<br>         username: ‘root’<br>         password: ‘root’<br>         driverClassName: com.mysql.jdbc.Driver<br>         maxPoolSize: 50<br>         idleTimeout: 60000<br>         validationTimeout: 30000<br>         isAutoCommit: false</pre><p>2.1.3 Point the following data sources to external databases.</p><p>None of the following databases needs DB scripts. The required tables will be automatically created.</p><ul><li>WSO2_CLUSTER_DB : This database is used for cluster coordination in the high-available (active/passive) deployment.</li><li>WSO2_PERMISSIONS_DB : Permission provider will access this DB to persist permissions and role—permission mappings.</li></ul><p>2.1.4 You need to point WSO2_METRICS_DB to an external datasource if the wso2.metrics:enabled:true and the wso2.metrics.jdbc:reporting:jdbc: enabled: true.</p><p>This is required by default to measure Server performance. The required DB scripts can be found at the &lt;MI_ANALYTICS_HOME&gt;/wso2/server/ dbscripts/metrics location.</p><p>2.1.5 Include third-party libraries and database drivers.</p><p>MI Analytics supports both OSGi and Non-OSGi libraries. When integrating a third-party library or DB driver, you need to include it in the appropriate location.</p><p>If the library is,</p><ul><li><strong>OSGi</strong> — Add it to the &lt;MI_ANALYTICS_HOME&gt;/lib directory and restart.</li><li><strong>Non-OSGi</strong> — Add it to the &lt;MI_ANALYTICS_HOME&gt;/jars directory and restart.</li></ul><p>2.1.6 Configure key stores</p><p>In the SSL handshake between the Micro Integrator and the MI Analytics servers, the client (MI) needs to verify the certificate presented by the server (MI Analytics). For this purpose, the client stores the trusted certificate of the server in the client-truststore.jks keystore.</p><ul><li>If you use a custom keystore in MI and/or MI Analytics, import the public key certificate of MI Analytics into the client-truststore.jks file of the MI.</li><li>To export the public key from the server and import it into the client’s trust store, follow the steps given in<a href="https://apim.docs.wso2.com/en/3.2.0/install-and-setup/setup/security/configuring-keystores/keystore-basics/creating-new-keystores/#step-1-generating-a-ca-signed-certificate"> Adding CA-signed certificates to keystores</a>.</li></ul><p>2.2 Configure MI Analytics Portal.</p><p>2.2.1 Open the &lt;MI_ANALYTICS_HOME&gt;/conf/portal/deployment.yaml file.</p><p>2.2.2 Edit the EI_ANALYTICS database to point to the same DB pointed in the deployment.yaml file of the MI Analytics ‘Server’ as we did before.</p><p>2.2.3 Point the following data sources to external databases. The required tables will be automatically created similar to the MI Analytics ‘server’.</p><ul><li>WSO2_DASHBOARD_DB — This is the database used for MI Analytics widgets and dashboards.</li><li>WSO2_PERMISSIONS_DB — The permission provider will access this DB to persist permissions and role — permission mappings.</li></ul><p>By following the above steps, you will be able to observe the statistics in the MI Analytics dashboard (https://localhost:9645/analytics-dashboard). :)</p><p>[1]. <a href="https://apim.docs.wso2.com/en/latest/mi-analytics/setting-up-mi-analytics/#step-1-download-the-servers">https://apim.docs.wso2.com/en/latest/mi-analytics/setting-up-mi-analytics/#step-1-download-the-servers</a></p><p>[2]. <a href="https://apim.docs.wso2.com/en/latest/mi-analytics/setting-up-mi-analytics/#system-requirements">https://apim.docs.wso2.com/en/latest/mi-analytics/setting-up-mi-analytics/#system-requirements</a></p><p>[3]. <a href="https://apim.docs.wso2.com/en/latest/mi-analytics/setting-up-mi-analytics/#step-25-optionally-set-up-load-balancing">https://apim.docs.wso2.com/en/latest/mi-analytics/setting-up-mi-analytics/#step-25-optionally-set-up-load-balancing</a></p><p>[4]. <a href="https://apim.docs.wso2.com/en/latest/mi-analytics/setting-up-mi-analytics/#step-23-optionally-enable-statistics-for-all-artifacts">https://apim.docs.wso2.com/en/latest/mi-analytics/setting-up-mi-analytics/#step-23-optionally-enable-statistics-for-all-artifacts</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1062796f799" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Starting WSO2 Stream Processor/ Streaming Integrator as a Linux Service]]></title>
            <link>https://medium.com/@methmas/starting-wso2-stream-processor-streaming-integrator-as-a-linux-service-6a85b40ec724?source=rss-8f19cbec3710------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a85b40ec724</guid>
            <category><![CDATA[stream-processing]]></category>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[services]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[analytics]]></category>
            <dc:creator><![CDATA[Methma Samaranayake]]></dc:creator>
            <pubDate>Thu, 08 Jul 2021 19:00:12 GMT</pubDate>
            <atom:updated>2021-07-09T08:51:46.175Z</atom:updated>
            <content:encoded><![CDATA[<p>To gain a competitive advantage in the fast-changing market, organizations need to make the best decision at the best time. Streaming analytics is the area which is providing this capability.</p><p>So, to address all the streaming analytics needs, WSO2 has introduced <strong>Streaming Integrator</strong> (SI)[1] which is the successor of <strong>Stream Processor</strong>(SP) [2] with more streaming integration capabilities.</p><p>When deploying these distributions, services are important background processes that are usually run while booting up and shut down with the OS. So, let’s discuss how to start these products as a Linux service on this blog.</p><p>To begin with, let’s set the CARBON_HOME as the first step. To do that, extract the SI/SP product distribution to a preferred directory in the Linux machine and set the environment variable <strong>CARBON_HOME</strong> to that location.</p><p>For Streaming Integrator, the start-up script is &lt;SI_HOME&gt;/bin/server.sh file. But for Stream Processor, the distribution is a bit different, which is having separate profiles such as worker and dashboard. &lt;SP_HOME&gt;/bin/worker.sh and &lt;SP_HOME&gt;/bin/dashboard.sh are the respective files for Stream Processor.</p><p>I have created sample bash scripts to run each profile. Please note that you need to change the <strong>CARBON_HOME </strong>and<strong> JAVA_HOME </strong>accordingly. Also, please note that I have used the ‘root’ user in this.</p><p>For Stream Processor please use the linked bash scripts for the <a href="https://github.com/Methma/SP_LinuxService/blob/main/sp_worker"><strong>Worker profile</strong></a> and the <a href="https://github.com/Methma/SP_LinuxService/blob/main/sp_dashboard"><strong>Dashboard profile</strong></a>. For Streaming Integrator the server can be started with <a href="https://github.com/Methma/Si_LinuxService/blob/main/si_server"><strong>this sample script</strong></a>.</p><p>As the next step, let’s add the script to <strong>/etc/init.d/</strong> directory of your Linux server.</p><p>Then make it executable using the below sample command by changing the &lt;script_name&gt; accordingly.</p><pre>sudo chmod a+x &lt;script_name&gt;</pre><p>The next step is installing the startup script to respective runlevels using the <strong>update-rc.d</strong> command. For example, give the following command for the sample script as below. The article [3] explains more about runlevels.</p><pre>sudo update-rc.d &lt;script_name&gt; defaults</pre><p>The “defaults” option in the above command makes the service to start in runlevels 2, 3, 4, 5 and stop in runlevels 0,1, 6.</p><p>Now all set to start the server. All you have to do is start, stop and restart the server using the <strong>service &lt;service name&gt;{start|stop|restart}</strong> command. Following is the sample command for server start.</p><pre>service &lt;script_name&gt; start</pre><p>Hope these steps will be helpful in your setup. Let’s meet with another blog. Enjoy!! :)</p><p><strong>PS: You can use the same sample scripts shared for Stream Processor to start WSO2 APIM Analytics 2.6.0, 3.0.0, 3.1.0, 3.2.0 versions, WSO2 EI-Analytics-6.4.0,6.5.0, 6.6.0 versions, and WSO2 Identity Analytics 5.7.0,5.8.0 versions too.</strong></p><p><strong>References:</strong></p><p>[1].<a href="https://ei.docs.wso2.com/en/latest/streaming-integrator/overview/overview/">https://ei.docs.wso2.com/en/latest/streaming-integrator/overview/overview/</a></p><p>[2].<a href="https://docs.wso2.com/display/SP440/Stream+Processor+Documentation">https://docs.wso2.com/display/SP440/Stream+Processor+Documentation</a></p><p>[3]. <a href="https://www.liquidweb.com/kb/linux-runlevels-explained/">https://www.liquidweb.com/kb/linux-runlevels-explained/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a85b40ec724" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Customize the alert email WSO2 APIM Analytics — 2.6.0]]></title>
            <link>https://medium.com/@methmas/customize-the-alert-email-wso2-apim-analytics-2-6-0-f691ac1507c5?source=rss-8f19cbec3710------2</link>
            <guid isPermaLink="false">https://medium.com/p/f691ac1507c5</guid>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[apim]]></category>
            <category><![CDATA[email]]></category>
            <category><![CDATA[alerts]]></category>
            <category><![CDATA[analytics]]></category>
            <dc:creator><![CDATA[Methma Samaranayake]]></dc:creator>
            <pubDate>Tue, 03 Sep 2019 08:32:24 GMT</pubDate>
            <atom:updated>2019-09-03T08:32:24.309Z</atom:updated>
            <content:encoded><![CDATA[<h3>Customize the alert email WSO2 APIM Analytics — 2.6.0</h3><p>You can modify the alert email by editing the APIM_ALERT_EMAIL_NOTIFICATION.siddhi app.</p><p>Following are the areas required to edit according to the requirement.</p><pre>@sink(type=&#39;email&#39;, content.type=&quot;text/html&quot;, @map(type =&#39;text&#39;, @payload(&#39;&lt;strong&gt;Message:&lt;/strong&gt;{{message}} &lt;br&gt;&lt;br&gt; &lt;strong&gt;Type:&lt;/strong&gt;{{type}} &lt;br&gt;&lt;br&gt; &lt;strong&gt;AlertTimestamp:&lt;/strong&gt;{{alertTimestamp}}&#39;)),subject=&#39;Alerts from WSO2 APIM Analytics&#39;,to=&#39;{{emails}}&#39;)@sink(type=&#39;email&#39;, content.type=&quot;text/html&quot;, @map(type =&#39;text&#39;, @payload(&#39;&lt;strong&gt;Message:&lt;/strong&gt;{{message}} &lt;br&gt;&lt;br&gt; &lt;strong&gt;Type:&lt;/strong&gt;{{type}} &lt;br&gt;&lt;br&gt; &lt;strong&gt;AlertTimestamp:&lt;/strong&gt;{{alertTimestamp}}&#39;)),subject=&#39;Alerts from WSO2 APIM Analytics&#39;,to=&#39;{{emails}}&#39;)define stream EmailNotificationStream ( type string, message string, alertTimestamp string, emails string);<br><br>@store(type = &#39;rdbms&#39;, datasource = &#39;APIM_ANALYTICS_DB&#39;)@PrimaryKey(&#39;userId&#39;, &#39;isSubscriber&#39;, &#39;isPublisher&#39;, &#39;isAdmin&#39;)define table ApimAlertStakeholderInfo(userId string, alertTypes string, emails string, isSubscriber bool, isPublisher bool, isAdmin bool);<br><br>@info(name = &#39;AbnormalBackendTimeAlert customise Email body&#39;)from AbnormalBackendTimeAlertStream#window.length(1) as A join ApimAlertStakeholderInfo as S on str:contains(S.alertTypes, &#39;AbnormalBackendTime&#39;) and ((A.apiCreator == S.userId and true == S.isPublisher ) or true == S.isAdmin )select &#39;AbnormalBackendTime&#39; as type , str:concat(&#39;Abnormal backend time detected for http &#39;, A.apiMethod, &#39; method of resource template:&#39;, A.apiResourceTemplate, &#39; in api:&#39;, A.apiName, &#39; of tenant domain:&#39;, A.apiCreatorTenantDomain, &#39;, threshold value:&#39;, A.thresholdBackendTime, &#39;ms.&#39;) as message, time:dateFormat(A.alertTimestamp, &#39;yyyy-MM-dd HH:mm:ss&#39;) as alertTimestamp, S.emails, A.apiCreatorTenantDomain as tenantDomain, S.userId as alertStakeholderUseridinsert into EmailAlertStream;<br><br>@info(name = &#39;AbnormalRequestsCountAlertStream customise Email body&#39;)from AbnormalRequestsCountAlertStream#window.length(1) as A join ApimAlertStakeholderInfo as S on str:contains(S.alertTypes, &#39;AbnormalRequestsPerMin&#39;) and ((A.applicationOwner == S.userId and true == S.isSubscriber ) or true == S.isAdmin )select &#39;AbnormalRequestsPerMin&#39; as type , str:concat(&#39;Abnormal request count detected during last minute using application &#39;, A.applicationName, &#39; owned by &#39;, A.applicationOwner, &#39; for api :&#39;, A.apiName, &#39;, abnormal request count:&#39;, A.requestCountPerMin, &quot;.&quot;) as message, time:dateFormat(A.alertTimestamp, &#39;yyyy-MM-dd HH:mm:ss&#39;) as alertTimestamp, S.emails, A.tenantDomain, S.userId as alertStakeholderUseridinsert into EmailAlertStream;<br><br>@info(name = &#39;RequestPatternChangedAlertStream customise Email body&#39;)from RequestPatternChangedAlertStream#window.length(1) as A join ApimAlertStakeholderInfo as S on str:contains(S.alertTypes, &#39;AbnormalRequestPattern&#39;) and ((A.applicationOwner == S.userId and true == S.isSubscriber ) or true == S.isAdmin )select &#39;AbnormalRequestPattern&#39; as type , str:concat(A.message, &#39; by user :&#39;, A.username, &#39; using application : &#39;, A.applicationName, &#39; owned by: &#39;, A.applicationOwner, &#39;.&#39;) as message, time:dateFormat(A.alertTimestamp, &#39;yyyy-MM-dd HH:mm:ss&#39;) as alertTimestamp, S.emails,  A.tenantDomain, S.userId as alertStakeholderUseridinsert into EmailAlertStream;<br><br>@info(name = &#39;AbnormalResponseTimeAlertStream customise Email body&#39;)from AbnormalResponseTimeAlertStream#window.length(1) as A join ApimAlertStakeholderInfo as S on str:contains(S.alertTypes, &#39;AbnormalResponseTime&#39;) and ((A.apiCreator == S.userId and true == S.isPublisher ) or true == S.isAdmin)select &#39;AbnormalResponseTime&#39; as type , str:concat(&#39;Abnormal response time detected for http &#39;, A.apiMethod, &#39; method of resource template:&#39;, A.apiResourceTemplate, &#39; in api:&#39;, A.apiName, &#39; of tenant domain:&#39;, A.apiCreatorTenantDomain, &#39;, threshold value:&#39;, A.thresholdResponseTime, &#39;ms.&#39;) as message, time:dateFormat(A.alertTimestamp, &#39;yyyy-MM-dd HH:mm:ss&#39;) as alertTimestamp, S.emails, A.apiCreatorTenantDomain as tenantDomain, S.userId as alertStakeholderUseridinsert into EmailAlertStream;<br><br>@info(name = &#39;ApiHealthMonitorAlertStream customise Email body&#39;)from ApiHealthMonitorAlertStream#window.length(1) as A join ApimAlertStakeholderInfo as S on str:contains(S.alertTypes, &#39;ApiHealthMonitor&#39;) and ((A.apiCreator == S.userId and true == S.isPublisher ) or true == S.isAdmin )select &#39;ApiHealthMonitor&#39; as type, str:concat(&#39;API:&#39;, apiName, &#39; &#39;, apiVersion, &#39;-&#39;, message) as message, time:dateFormat(A.alertTimestamp, &#39;yyyy-MM-dd HH:mm:ss&#39;) as alertTimestamp, S.emails, A.apiCreatorTenantDomain as tenantDomain, S.userId as alertStakeholderUseridinsert into EmailAlertStream;<br><br>@info(name = &#39;TierLimitHittingAlertStream customise Email body&#39;)from TierLimitHittingAlertStream#window.length(1) as A join ApimAlertStakeholderInfo as S on str:contains(S.alertTypes, &#39;FrequentTierLimitHitting&#39;) and ((A.subscriber == S.userId and true == S.isSubscriber ) or true == S.isAdmin )select &#39;FrequentTierLimitHitting&#39; as type ,ifThenElse(str:contains(A.message, &#39;Application frequently goes beyond the allocated quota&#39;), str:concat(&quot;The application &quot;, A.applicationName, &quot; owned by &quot;, A.subscriber, &quot; frequently goes beyond the allocated quota when accessing the &quot;, A.apiName, &quot; API.&quot;),str:concat(A.message , &quot; Using the &quot;, A.applicationName, &quot; application owned by &quot;, A.subscriber, &quot;.&quot;)) as message, time:dateFormat(A.alertTimestamp, &#39;yyyy-MM-dd HH:mm:ss&#39;) as alertTimestamp, S.emails, A.apiCreatorTenantDomain as tenantDomain, S.userId as alertStakeholderUseridinsert into EmailAlertStream;<br><br>@info(name = &#39;IpAccessAbnormalityAlertStream customise Email body&#39;)from IpAccessAbnormalityAlertStream#window.length(1) AS A join ApimAlertStakeholderInfo as S on str:contains(S.alertTypes, &#39;UnusualIPAccess&#39;) and ((A.applicationOwner == S.userId and true == S.isSubscriber ) or true == S.isAdmin )select &#39;UnusualIPAccess&#39; as type , str:concat(&quot;A request from a &quot;, ifThenElse(str:contains(message, &#39;old&#39;), &#39;old&#39;, &#39;new&#39;), &quot; IP (&quot;, ip, &quot;) detected by user:&quot; , A.username, &quot; using application:&quot;, applicationName, &quot; owned by &quot;, applicationOwner, &quot;.&quot;) as message, time:dateFormat(A.alertTimestamp, &#39;yyyy-MM-dd HH:mm:ss&#39;) as alertTimestamp, S.emails, A.tenantDomain, S.userId as alertStakeholderUseridinsert into EmailAlertStream;</pre><p>For further information about configuring email alerts please refer to [1].</p><p>[1]. <a href="https://docs.wso2.com/display/AM260/Configuring+Alerts">https://docs.wso2.com/display/AM260/Configuring+Alerts</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f691ac1507c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[XSLT Mediator to Capture the First and Last Elements of an XML input and WSO2 EI 6.4.0]]></title>
            <link>https://medium.com/@methmas/xslt-mediator-to-capture-the-first-and-last-elements-of-an-xml-input-and-wso2-ei-6-4-0-55798465614d?source=rss-8f19cbec3710------2</link>
            <guid isPermaLink="false">https://medium.com/p/55798465614d</guid>
            <category><![CDATA[xslt]]></category>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[ei]]></category>
            <dc:creator><![CDATA[Methma Samaranayake]]></dc:creator>
            <pubDate>Thu, 13 Dec 2018 08:58:32 GMT</pubDate>
            <atom:updated>2021-09-18T08:23:05.010Z</atom:updated>
            <content:encoded><![CDATA[<h3>XSLT Mediator to Capture the First and Last Elements of an XML input — WSO2 EI 6.4.0</h3><p>Let’s capture the first and the last elements and change them accordingly.</p><p>Sample input:</p><blockquote>&lt;order&gt;<br> &lt;orderDetails&gt;<br> &lt;orderType&gt;AAA&lt;/orderType&gt;<br> &lt;orderDescription&gt;11111111111111111111&lt;/orderDescription&gt;<br> &lt;/orderDetails&gt;<br> &lt;orderDetails&gt;<br> &lt;orderType&gt;BBB&lt;/orderType&gt;<br> &lt;orderDescription&gt;2222222222222222222&lt;/orderDescription&gt;<br> &lt;/orderDetails&gt;<br> &lt;orderDetails&gt;<br> &lt;orderType&gt;CCC&lt;/orderType&gt;<br> &lt;orderDescription&gt;333333333333333333333&lt;/orderDescription&gt;<br> &lt;/orderDetails&gt;<br> &lt;orderDetails&gt;<br> &lt;orderType&gt;DDD&lt;/orderType&gt;<br> &lt;orderDescription&gt;444444444444444444444&lt;/orderDescription&gt;<br> &lt;/orderDetails&gt;<br>&lt;/order&gt;</blockquote><p>Expected output:</p><blockquote>&lt;order&gt; &lt;orderHeader&gt; &lt;orderType/&gt; &lt;orderID&gt;1111&lt;/orderID&gt; &lt;/orderHeader&gt; &lt;/order&gt;</blockquote><p>Sample XSLT to capture the first order and get it’s substring of 4 characters.</p><blockquote>&lt;?xml version=”1.0&quot; encoding=”UTF-8&quot;?&gt;<br>&lt;xsl:stylesheet version=”1.0&quot;<br>xmlns:xsl=”<a href="http://www.w3.org/1999/XSL/Transform">http://www.w3.org/1999/XSL/Transform</a>&quot;&gt;<br>&lt;xsl:output method=”xml” omit-xml-declaration=”yes” indent=”yes”/&gt;<br>&lt;xsl:template match=”/”&gt;<br>&lt;order&gt;<br>&lt;xsl:for-each select=”order/orderDetails[1]”&gt;<br>&lt;orderHeader&gt;<br>&lt;orderType&gt;&lt;xsl:value-of select=”recordType”/&gt;&lt;/orderType&gt;<br>&lt;orderID&gt;&lt;xsl:value-of select=”substring(orderDescription/text(),1,4)”/&gt;&lt;/orderID&gt;<br>&lt;/orderHeader&gt;<br>&lt;/xsl:for-each&gt;<br>&lt;/order&gt;<br>&lt;/xsl:template&gt;<br>&lt;/xsl:stylesheet&gt;</blockquote><p>The following sample is to capture the last element and make it as this sample output.</p><blockquote>&lt;order&gt; &lt;orderFooter&gt; &lt;orderType&gt;DDD&lt;/orderType&gt; &lt;orderID&gt;4444&lt;/orderID&gt; &lt;/orderFooter&gt; &lt;/order&gt;</blockquote><p>This is the sample XSLT file.</p><blockquote>&lt;?xml version=”1.0&quot; encoding=”UTF-8&quot;?&gt;<br>&lt;xsl:stylesheet version=”1.0&quot;<br>xmlns:xsl=”<a href="http://www.w3.org/1999/XSL/Transform">http://www.w3.org/1999/XSL/Transform</a>&quot;&gt;<br>&lt;xsl:template match=”/”&gt;<br> &lt;order&gt;<br>&lt;xsl:for-each select=”order/orderDetails[last()]”&gt;<br> &lt;orderFooter&gt;<br> &lt;orderType&gt;&lt;xsl:value-of select=”orderType”/&gt;&lt;/orderType&gt;<br> &lt;orderID&gt;&lt;xsl:value-of select=”substring(orderDescription/text(),1,4)”/&gt;&lt;/orderID&gt;<br>&lt;/orderFooter&gt;<br>&lt;/xsl:for-each&gt;<br>&lt;/order&gt;<br>&lt;/xsl:template&gt;<br>&lt;/xsl:stylesheet&gt;</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55798465614d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Custom Widgets WSO2 Stream Processor - 4.1.0]]></title>
            <link>https://medium.com/@methmas/creating-custom-widgets-wso2-sp-4-1-0-16672c3741d3?source=rss-8f19cbec3710------2</link>
            <guid isPermaLink="false">https://medium.com/p/16672c3741d3</guid>
            <category><![CDATA[widget]]></category>
            <category><![CDATA[sp]]></category>
            <category><![CDATA[custom]]></category>
            <category><![CDATA[stream-processor]]></category>
            <category><![CDATA[wso2]]></category>
            <dc:creator><![CDATA[Methma Samaranayake]]></dc:creator>
            <pubDate>Fri, 20 Jul 2018 08:43:29 GMT</pubDate>
            <atom:updated>2018-11-07T06:02:52.775Z</atom:updated>
            <content:encoded><![CDATA[<h4>Interactive Drill-Down Table</h4><p>You can implement your own custom widgets and use them within the Dashboard portal of WSO2 Stream Processor.</p><p>A widget in Dashboard portal is a simple ReactJS component that can be used to visualize information.</p><p>Let’s write our custom widget (HelloWorld) which is having a table. By clicking a row of the table, you can use that data in another widget. Simply it’s like a drill down table.</p><p>The directory structure of your HelloWorld is as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/1*gJipQbDcWRsztGMp-pppxQ.png" /></figure><ol><li>Copy following content to package.json and webpack.config.js respectively. Webpack is required for building a widget.</li></ol><p><strong>package.json</strong></p><pre>{<br>  &quot;name&quot;: &quot;hello-world-widget&quot;,<br>  &quot;version&quot;: &quot;1.0.0&quot;,<br>  &quot;private&quot;: true,<br>  &quot;dependencies&quot;: {<br>    &quot;react&quot;: &quot;^16.1.1&quot;,<br>    &quot;react-dom&quot;: &quot;^16.1.1&quot;,<br>    &quot;axios&quot;: &quot;^0.17.1&quot;,<br>    &quot;@wso2-dashboards/widget&quot;: &quot;1.2.0&quot;<br>  },<br>  &quot;scripts&quot;: {<br>    &quot;build&quot;: &quot;webpack -p&quot;<br>  },<br>  &quot;devDependencies&quot;: {<br>    &quot;webpack&quot;: &quot;^3.5.6&quot;,<br>    &quot;ajv&quot;: &quot;^5.2.2&quot;,<br>    &quot;babel-core&quot;: &quot;^6.25.0&quot;,<br>    &quot;babel-loader&quot;: &quot;^7.1.1&quot;,<br>    &quot;babel-preset-es2015&quot;: &quot;^6.24.1&quot;,<br>    &quot;babel-preset-react&quot;: &quot;^6.24.1&quot;,<br>    &quot;babel-register&quot;: &quot;^6.26.0&quot;,<br>    &quot;copy-webpack-plugin&quot;: &quot;^4.2.0&quot;,<br>    &quot;node-sass&quot;: &quot;^4.5.3&quot;,<br>    &quot;sass-loader&quot;: &quot;^6.0.6&quot;<br>  },<br>  &quot;main&quot;: &quot;webpack.config.js&quot;,<br>  &quot;author&quot;: &quot;&quot;,<br>  &quot;license&quot;: &quot;ISC&quot;,<br>  &quot;description&quot;: &quot;&quot;<br>}</pre><p><strong>webpack.config.js</strong></p><pre>const path = require(&#39;path&#39;);<br>const webpack = require(&#39;webpack&#39;);<br>const CopyWebpackPlugin = require(&#39;copy-webpack-plugin&#39;);<br><br>module.exports = {<br>    context: path.resolve(__dirname, &#39;./src&#39;),<br>    entry: {<br>        index: &#39;./HelloWorld.jsx&#39;<br>    },<br>    output: {<br>        path: path.resolve(__dirname, &#39;./dist/HelloWorld/&#39;),<br>        filename: &#39;HelloWorld.js&#39;<br>    },<br>    module: {<br>        loaders: [<br>            {<br>                test: /\.html$/,<br>                use: [{loader: &#39;html-loader&#39;}]<br>            },<br>            {<br>                test: /\.js$/,<br>                exclude: /node_modules/,<br>                use: [<br>                    {<br>                        loader: &#39;babel-loader&#39;,<br>                        query: {<br>                            presets: [&#39;es2015&#39;, &#39;react&#39;]<br>                        }<br>                    }<br>                ]<br>            },<br>            {<br>                test: /\.(png|jpg|svg|cur|gif|eot|svg|ttf|woff|woff2)$/,<br>                use: [&#39;url-loader&#39;]<br>            },<br>            {<br>                test: /\.jsx?$/,<br>                exclude: /(node_modules)/,<br>                loader: &#39;babel-loader&#39;,<br>                query: {<br>                    presets: [&#39;es2015&#39;, &#39;react&#39;]<br>                }<br>            },<br>            {<br>                test: /\.css$/,<br>                use: [&#39;style-loader&#39;, &#39;css-loader&#39;]<br>            },<br>            {<br>                test: /\.scss$/,<br>                use: [{loader: &#39;style-loader&#39;}, {loader: &#39;css-loader&#39;}, {loader: &#39;sass-loader&#39;}]<br>            }<br><br>        ]<br>    },<br>    plugins: [<br>        new CopyWebpackPlugin([<br>            {from: path.resolve(__dirname, &#39;./src/resources/&#39;)}<br>        ])<br>    ],<br>    resolve: {<br>        extensions: [&#39;.js&#39;, &#39;.json&#39;, &#39;.jsx&#39;, &#39;.scss&#39;]<br>    }<br>};</pre><p>2. HelloWorld.jsx under src directory contains all the logic for our widget.</p><p>In order to identify a particular ReactJS component as a widget by the dashboard portal, it needs to register itself as a widget in the portal.</p><pre>import React, { Component } from &#39;react&#39;;</pre><pre>class HelloWorld extends Widget {<br>    render() {<br>        return (//Add rendering logic here);<br>}<br><br><strong>global.dashboard.registerWidget(&#39;HelloWorld&#39;, HelloWorld);</strong></pre><p>3. When working with widgets, we need to use the ‘WidgetChannelManager’ to import the channel manager to access the database. To do that, I have created a separate file ‘ExtendedWidget’ as follows.</p><pre>import React from &#39;react&#39;;<br>import Widget from &#39;@wso2-dashboards/widget&#39;;<br><br>let widgetChannelManager = null;<br><br>export default class ExtendedWidget extends Widget {<br><br>    constructor(props) {<br>        super(props);<br>    }<br><br>    getWidgetChannelManager() {<br>        if(!widgetChannelManager) {<br>            widgetChannelManager=new WidgetChannelManager();<br>        }<br><br>        return widgetChannelManager;<br>    }<br><br>}</pre><p>4. Following is the ‘HelloWorld.jsx’ with the logic. Here, we can use the componentDidMount() method to pass the provider configurations through WidgetChannelManager().subscribeWidget(). Then the data which related to that configs would be retrieved from the database.</p><p>Please note that in WSO2 SP 4.1.0 we do not provide the facility for retrieving the table and meta data configs from a separate file even though we can do it in SP 4.2.0.</p><p>The action of the row click is added under the handleData(). Here in the sample, I have added console.info as the action.</p><pre>import React, { Component } from &#39;react&#39;;<br>import ExtendedWidget from &#39;./ExtendedWidget&#39;;<br>import Widget from &#39;@wso2-dashboards/widget&#39;;<br>import VizG from &#39;react-vizgrammar&#39;;<br>import Axios from &#39;axios&#39;;<br><br>const COOKIE = &#39;DASHBOARD_USER&#39;;<br><br>class HelloWorld extends Widget {<br>    constructor(props) {<br>         super(props);<br><br><br>    this.tableConfig = {<br>                     //add table configs here<br>                 };<br><br>    this.metadata = {<br>                 //add meta data for the table here<br>             };<br><br>    this.state = {<br>                id: props.id,<br>                data: [],<br>                config: null,<br>                dataProviderConf: &quot;&quot;<br>                };<br><br>            this.handleWidgetData = this.handleWidgetData.bind(this);<br>    }<br><br>    componentDidMount() {<br><br>            let httpClient = Axios.create({<br>                baseURL: window.location.origin + window.contextPath,<br>                timeout: 2000,<br>                headers: {&quot;Authorization&quot;: &quot;Bearer &quot; + HelloWorld.getUserCookie().SDID},<br>            });<br><br>            httpClient.defaults.headers.post[&#39;Content-Type&#39;] = &#39;application/json&#39;;<br>            httpClient<br>                .get(`/apis/widgets/${this.props.widgetID}`)<br>                .then((message) =&gt; {<br><br>                    try{<br><br>                    super.getWidgetChannelManager().subscribeWidget(this.props.id,this.handleWidgetData,message.data.configs.providerConfig)<br><br>                    }<br>                    catch(e){<br>	 		//handle error<br>                    }<br><br><br>                })<br>                .catch((error) =&gt; {<br>                    // TODO Handle Error<br>                });<br>        }<br><br>    static getUserCookie() {<br>                const arr = document.cookie.split(&#39;;&#39;);<br>                for (let i = 0; i &lt; arr.length; i++) {<br>                    let c = arr[i];<br>                    while (c.charAt(0) === &#39; &#39;) {<br>                        c = c.substring(1);<br>                    }<br>                    if (c.indexOf(COOKIE) === 0) {<br>                        return JSON.parse(c.substring(COOKIE.length + 1, c.length));<br>                    }<br>                }<br>                return null;<br>            }<br><br>    handleWidgetData(data) {<br>        this.setState({<br>            data: data.data<br>        })<br>    }<br><br>    render() {<br><br>        return (<br>                &lt;VizG config={this.tableConfig} data={this.state.data} metadata={this.metadata} onClick={this.handleData} /&gt;<br>        );<br>    }<br><br>    handleData(row) {<br>        //Add the data handling logic here. As of now we have added the console.info() here.<br>        console.info(row);<br>    }<br>}<br><br>global.dashboard.registerWidget(&#39;HelloWorld&#39;, HelloWorld);</pre><p>5. The providerConfigurations added to the widgetConf.json file.</p><p>In widgetConf.json you can add the provider/subscriber related information to the subscriber widget (widget which will direct after the row click) and the publisher widget (table with row click) according to the use case as follows.</p><p>Subscriber widget:</p><pre>&quot;pubsub&quot;: {<br>            &quot;types&quot;: [<br>                &quot;subscriber&quot;<br>            ]<br>        }</pre><p>Publisher widget:</p><pre>&quot;pubsub&quot;: {<br>          &quot;types&quot;: [<br>		&quot;publisher&quot;<br>	   ]<br>        }</pre><p>Following is the sample widgetConf.json file, for a publisher widget.</p><pre>{<br>  &quot;name&quot;: &quot;HelloWorld&quot;,<br>  &quot;id&quot;: &quot;HelloWorld&quot;,<br>  &quot;thumbnailURL&quot;: &quot;&quot;,<br>  &quot;configs&quot;: {<br>    &quot;providerConfig&quot;: {<br>      &quot;configs&quot;: {<br>        &quot;type&quot;: &quot;RDBMSBatchDataProvider&quot;,<br>        &quot;config&quot;: {<br>          &quot;datasourceName&quot;: &quot;HELLOWorld_DB&quot;,<br>          &quot;query&quot;: &quot;select * from helloWorldActivities&quot;,<br>          &quot;tableName&quot;: &quot;helloWorldActivities&quot;,<br>          &quot;incrementalColumn&quot;: &quot;engine&quot;,<br>          &quot;timeColumns&quot;: &quot;&quot;,<br>          &quot;publishingInterval&quot;: 2,<br>          &quot;purgingInterval&quot;: 60,<br>          &quot;publishingLimit&quot;: 30,<br>          &quot;purgingLimit&quot;: 30,<br>          &quot;isPurgingEnable&quot;: false<br>        }<br>      }<br>    }<br>  },<br>  &quot;pubsub&quot;: {<br>    &quot;types&quot;: [<br>      &quot;publisher&quot;<br>    ]<br>  }<br>}</pre><p>6. You need to install the following npm modules (by going to the &lt;WIDGET_ROOT&gt;) before build this widget.</p><pre>npm i @wso2-dashboards/widget<br><br>npm i react-vizgrammar</pre><p>7. Following command can be used to build the widget.</p><pre>npm run build</pre><p>8. Once the build is a success the final widget directory will be created at &lt;WIDGET_ROOT&gt;/dist directory.</p><p>Copy the &lt;WIDGET_ROOT&gt;/dist/HelloWorld directory into &lt;SP_HOME&gt;/wso2/dashboards/deployment/web-ui-apps/portal/extensions/widgets directory.</p><p>Finally, you will be able to see the ‘HelloWorld’ custom widget in your widget list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*01Sn8PtAk8fCyrTn5WKbNw.png" /></figure><ul><li>You can find the sample project in the following location:</li></ul><p><a href="https://github.com/Methma/WSO2-SP410-CustomWidget-HelloWorld">Methma/WSO2-SP410-CustomWidget-HelloWorld</a></p><p>References:</p><ol><li><a href="https://wso2.github.io/react-vizgrammar/#/table-charts">https://wso2.github.io/react-vizgrammar/#/table-charts</a></li><li><a href="https://www.npmjs.com/package/@wso2-dashboards/widget">https://www.npmjs.com/package/@wso2-dashboards/widget</a></li><li><a href="https://docs.wso2.com/display/SP410/Creating+Custom+Widgets">https://docs.wso2.com/display/SP410/Creating+Custom+Widgets</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16672c3741d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WSO2 EI/ DSS for Complex DDL with Oracle]]></title>
            <link>https://medium.com/@methmas/wso2-ei-dss-for-complex-ddl-with-oracle-264ab3587740?source=rss-8f19cbec3710------2</link>
            <guid isPermaLink="false">https://medium.com/p/264ab3587740</guid>
            <category><![CDATA[wso2-dss]]></category>
            <category><![CDATA[complex-ddl]]></category>
            <category><![CDATA[oracle]]></category>
            <category><![CDATA[nested-ddl]]></category>
            <category><![CDATA[wso2-ei]]></category>
            <dc:creator><![CDATA[Methma Samaranayake]]></dc:creator>
            <pubDate>Thu, 15 Mar 2018 18:08:15 GMT</pubDate>
            <atom:updated>2018-09-30T08:49:01.821Z</atom:updated>
            <content:encoded><![CDATA[<h4>Nested DDL + WSO2 EI/DSS + Oracle</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*fm1pt9_0NhJTTUdhOx2x3Q.jpeg" /><figcaption>Image source: <a href="http://www.containerstore.com/">www.containerstore.com</a></figcaption></figure><p>I have discussed using basic UDT types with WSO2 EI /DSS for Oracle database in my <a href="https://medium.com/@methmas/calling-oracle-functions-with-user-defined-types-udt-using-wso2-enterprise-integrator-ei-5b80658299bc">previous</a> blog post. So I will be discussing complex DDL (Nested DDL), UDT types which also hasa UDT type inside.</p><p>For <strong>nested DDL types</strong>, the recommended method is to use <strong>Oracle Ref cursors</strong> when retrieving data.</p><p><strong>UDT Type</strong></p><pre>create or replace TYPE CUSTOMER_INFO FORCE AS OBJECT (<br>  CUSTOMER_ID           VARCHAR2(10),<br>  CUSTOMER_NAME         VARCHAR2(25),<br>  CUSTOMER_PROFILE      VARCHAR2(20), <br>  CUSTOMER_OFFICE       VARCHAR2(10),<br>  REPORT_TYPE           VARCHAR2(15), <br>  REPORTING_MANAGER  VARCHAR2(25)   <br>);</pre><pre>create or replace TYPE CUSTOMER FORCE IS TABLE OF CUSTOMER_INFO;</pre><p><strong>Oracle Function</strong></p><pre>create or replace function my_function1 return SYS_REFCURSOR<br>   is<br>      l_data CUSTOMER;<br>      cur sys_refcursor;<br>  begin<br>       l_data := CUSTOMER();</pre><pre>for i in 1..5<br>      loop<br>          l_data.extend;<br>         l_data(i) := CUSTOMER_INFO( i, i, &#39;row &#39; || i, &#39;offe&#39;, &#39;type&#39;, &#39;manager&#39; );<br>      end loop;<br>      open cur for select * from table(l_data);<br>    return cur;<br>  end;<br>  /</pre><p><strong>Data Service in WSO2 EI / DSS</strong></p><pre>&lt;data name=&quot;callClientInfoSP&quot; transports=&quot;http https local&quot;&gt;<br>   &lt;config enableOData=&quot;false&quot; id=&quot;OraDB&quot;&gt;<br>      &lt;property name=&quot;driverClassName&quot;&gt;oracle.jdbc.driver.OracleDriver&lt;/property&gt;<br>      &lt;property name=&quot;url&quot;&gt;jdbc:oracle:thin:@xxxx:1521/ora11g&lt;/property&gt;<br>      &lt;property name=&quot;username&quot;&gt;xxxx&lt;/property&gt;<br>      &lt;property name=&quot;password&quot;&gt;xxxx&lt;/property&gt;<br>   &lt;/config&gt;<br>   &lt;query id=&quot;getClientInfoQ&quot; useConfig=&quot;OraDB&quot;&gt;<br>      &lt;sql&gt;{call ?:=my_function1()}&lt;/sql&gt;<br>      &lt;result element=&quot;Rows&quot; rowName=&quot;row&quot; useColumnNumbers=&quot;true&quot;&gt;<br>         &lt;element column=&quot;1&quot; name=&quot;ID&quot; xsdType=&quot;string&quot;/&gt;<br>         &lt;element column=&quot;2&quot; name=&quot;Name&quot; xsdType=&quot;string&quot;/&gt;<br>         &lt;element column=&quot;3&quot; name=&quot;Profile&quot; xsdType=&quot;string&quot;/&gt;<br>         &lt;element column=&quot;4&quot; name=&quot;Office&quot; xsdType=&quot;string&quot;/&gt;<br>         &lt;element column=&quot;5&quot; name=&quot;Manager&quot; xsdType=&quot;string&quot;/&gt;<br>      &lt;/result&gt;<br>      &lt;param name=&quot;cur&quot; ordinal=&quot;1&quot; sqlType=&quot;ORACLE_REF_CURSOR&quot; type=&quot;OUT&quot;/&gt;<br>   &lt;/query&gt;<br>   &lt;operation name=&quot;getClientInfoOp&quot;&gt;<br>      &lt;call-query href=&quot;getClientInfoQ&quot;/&gt;<br>   &lt;/operation&gt;<br>&lt;/data&gt;</pre><p><em>Thanks for reading! Hope this simple sample helped you.. :)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=264ab3587740" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WSO2 API Manager Jaggery API Call for Publisher APIs in Windows PowerShell]]></title>
            <link>https://medium.com/@methmas/wso2-api-manager-jaggery-api-call-for-publisher-apis-in-windows-powershell-82567ecf33c0?source=rss-8f19cbec3710------2</link>
            <guid isPermaLink="false">https://medium.com/p/82567ecf33c0</guid>
            <category><![CDATA[powershell]]></category>
            <category><![CDATA[jaggery]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[api-publisher]]></category>
            <category><![CDATA[wso2]]></category>
            <dc:creator><![CDATA[Methma Samaranayake]]></dc:creator>
            <pubDate>Mon, 05 Feb 2018 19:24:07 GMT</pubDate>
            <atom:updated>2018-02-05T19:24:07.499Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*JwNT_d-YI2wvQ3By1uGg5w.png" /></figure><p>You can use <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-5.1"><strong>Invoke-WebRequest</strong></a><strong> </strong>in <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/?view=powershell-5.1">Microsoft.PowerShell.Utility</a> package in invoking WSO2 APIM Jaggery APIs by passing parameters as follows.</p><pre>Invoke-WebRequest  -Method POST -Uri $appApiUrl -WebSession $session -Body $postParams</pre><p>To call the APIs first you need to log in to the in to API Publisher web application (login.jag).</p><pre>$loginApiUrl = &#39;http://localhost:9763/publisher/site/blocks/user/login/ajax/login.jag&#39;</pre><pre><br>$loginPArams = @{action=&#39;login&#39;;username=&#39;admin&#39;;password=&#39;admin&#39;}</pre><pre><br>Invoke-WebRequest -Uri $loginApiUrl -Method POST -Body $loginPArams -SessionVariable apim -usebasicparsing</pre><p>Can invoke the same app to log out as follows.</p><pre>$logoutApiUrl = &#39;http://localhost:9763/publisher/site/blocks/user/login/ajax/login.jag?&#39;</pre><pre><br>$logoutParams =@{action=&#39;logout&#39;}</pre><pre><br>Invoke-WebRequest -Uri $logoutApiUrl -Method POST -Body $logoutParams  -usebasicparsing</pre><p>You can use the following commands to invoke add.jag API to add new API to WSO2 API Manager.</p><p>Here I am passing the swagger file of a sample API as parameters.</p><pre>$postParamsCustomer=@{action=&#39;addAPI&#39;;name=&#39;gw-balance&#39;;context=&#39;/gw-balance&#39;;version=&#39;1.0&#39;;visibility=&#39;public&#39;;thumbUrl=&#39;&#39;;description=&#39;Verify a phone number&#39;;tags=&#39;phone,mobile,multimedia&#39;;endpointType=&#39;nonsecured&#39;;tiersCollection=&#39;Gold,Bronze&#39;;http_checked=&#39;http&#39;;https_checked=&#39;https&#39;;swagger=&#39;{&quot;swagger&quot;:&quot;2.0&quot;,&quot;info&quot;:{&quot;version&quot;:&quot;v1&quot;,&quot;title&quot;:&quot;BalanceViewApi&quot;},&quot;host&quot;:&quot;balanceviewapi.dev.payoneer.com&quot;,&quot;schemes&quot;:[&quot;http&quot;],&quot;paths&quot;:{&quot;/API/Balances&quot;:{&quot;get&quot;:{&quot;tags&quot;:[&quot;Balances&quot;],&quot;operationId&quot;:&quot;Balances_GetBalances&quot;,&quot;consumes&quot;:[],&quot;produces&quot;:[&quot;application/json&quot;,&quot;text/json&quot;,&quot;text/html&quot;,&quot;application/xml&quot;,&quot;text/xml&quot;],&quot;responses&quot;:{&quot;200&quot;:{&quot;description&quot;:&quot;OK&quot;,&quot;schema&quot;:{&quot;type&quot;:&quot;array&quot;,&quot;items&quot;:{&quot;$ref&quot;:&quot;#/definitions/BaseBalance&quot;}}}}}}},&quot;definitions&quot;:{&quot;BaseBalance&quot;:{&quot;type&quot;:&quot;object&quot;,&quot;properties&quot;:{&quot;BalanceId&quot;:{&quot;type&quot;:&quot;string&quot;},&quot;Currency&quot;:{&quot;type&quot;:&quot;string&quot;},&quot;AvailableBalance&quot;:{&quot;format&quot;:&quot;double&quot;,&quot;type&quot;:&quot;number&quot;},&quot;LedgerBalance&quot;:{&quot;format&quot;:&quot;double&quot;,&quot;type&quot;:&quot;number&quot;},&quot;BalanceType&quot;:{&quot;format&quot;:&quot;int32&quot;,&quot;enum&quot;:[1,2,3],&quot;type&quot;:&quot;integer&quot;},&quot;UpdateDate&quot;:{&quot;format&quot;:&quot;date-time&quot;,&quot;type&quot;:&quot;string&quot;},&quot;Status&quot;:{&quot;format&quot;:&quot;int32&quot;,&quot;type&quot;:&quot;integer&quot;},&quot;StatusCategory&quot;:{&quot;format&quot;:&quot;int32&quot;,&quot;type&quot;:&quot;integer&quot;},&quot;RemoteStatus&quot;:{&quot;format&quot;:&quot;int32&quot;,&quot;type&quot;:&quot;integer&quot;},&quot;LocalStatus&quot;:{&quot;format&quot;:&quot;int32&quot;,&quot;type&quot;:&quot;integer&quot;},&quot;RemoteStatusCategory&quot;:{&quot;format&quot;:&quot;int32&quot;,&quot;type&quot;:&quot;integer&quot;},&quot;LocalStatusCategory&quot;:{&quot;format&quot;:&quot;int32&quot;,&quot;type&quot;:&quot;integer&quot;}}}}}&#39;;endpoint_config=&#39;{&quot;production_endpoints&quot;:{&quot;url&quot;:&quot;http://www.mocky.io/v2/5a530961300000cf0c1ebda9&quot;,&quot;config&quot;:null},&quot;endpoint_type&quot;:&quot;http&quot;}&#39;}</pre><p>Please note that the ‘-usebasicparsing’ is used to avoid “The response content cannot be parsed because the Internet Explorer engine is not available” error.</p><h4>References:</h4><p>[1]. <a href="https://docs.wso2.com/display/AM1100/Publisher+APIs">https://docs.wso2.com/display/AM1100/Publisher+APIs</a></p><p>[2]. <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-5.1">https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-5.1</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82567ecf33c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Write a XACML Policy with WSO2 API Manager / Identity Server]]></title>
            <link>https://medium.com/@methmas/write-a-xacml-policy-with-wso2-api-manager-identity-server-6e56ed887793?source=rss-8f19cbec3710------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e56ed887793</guid>
            <category><![CDATA[api-manager]]></category>
            <category><![CDATA[sub-resources]]></category>
            <category><![CDATA[identity-server]]></category>
            <category><![CDATA[xacml]]></category>
            <category><![CDATA[wso2]]></category>
            <dc:creator><![CDATA[Methma Samaranayake]]></dc:creator>
            <pubDate>Tue, 02 Jan 2018 08:16:02 GMT</pubDate>
            <atom:updated>2018-01-02T08:16:54.573Z</atom:updated>
            <content:encoded><![CDATA[<h4>A XACML Policy which cover complex URL patterns with sub resources</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*FykdZnIqDSRlYlQrQg9VEQ.png" /></figure><h4><strong>What is XACML Policy?</strong></h4><p>According to the specification, XACML is to express these well-established ideas in the field of <strong><em>access control</em></strong> policy using an extension language of XML. <strong>XACML</strong> stands for “<strong>eXtensible Access Control Markup Language</strong>”. The standard defines a declarative fine-grained, attribute-based <a href="https://en.wikipedia.org/wiki/Access_control">access control</a> policy language,an architecture, and a processing model describing how to evaluate access requests according to the rules defined in policies.</p><h4><strong>Why XACML in WSO2 API Manager Instead of Resource Level Scope?</strong></h4><p>Before writing the XACML policy, you can download WSO2 Identity Server /API Manager from here and can start the server according to your OS. The starting file resides at WSO2 _HOME/bin.</p><pre>sh wso2server.sh (Linux)<br>wso2server.bat (Windows)</pre><p>In WSO2 API Manager, you define access policies as scopes into resource level instead of defining XACML policies. (‘Applying a scope’ section in the <a href="https://docs.wso2.com/display/AM210/Key+Concepts">document</a>). But these policies will be applying only to ‘role’ level.Even though, XACML policies facilitates in providing access control into both the ‘role’ and ‘attribute’ level.</p><h4>XACML Policy Sample</h4><p>To write the XACML policy, go to the Policy Administration under Entitlement/PAP in the management console. Select Add New Entitlement Policy and under that select Write Policy in XML to add your sample policy.</p><p>This sample policy is addressing the following scenario.</p><p>Both USER1 and USER2 are the users which are not recorded under http://wso2.org/claims/username claim. The API contains 2 sub resources. <br>USER1 is having both READ/WRITE permissions for the subresource1 and the USER1 is only having READ permission for the subresource2.<br>USER2 has both READ/WRITE permissions for subresource2 and the USER2 can READ only the subresource1.<br>All the other users are not allowed for both subresource1 and 2.</p><pre>&lt;Policy xmlns=&quot;urn:oasis:names:tc:xacml:3.0:core:schema:wd-17&quot;  PolicyId=&quot;ClientPolicy5&quot; RuleCombiningAlgId=&quot;urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable&quot; Version=&quot;1.0&quot;&gt;<br>   &lt;Target&gt;<br>      &lt;AnyOf&gt;<br>         &lt;AllOf&gt;<br>            &lt;Match MatchId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-regexp-match&quot;&gt;<br>               &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;https://172.17.0.1:8246/API/1.0.0/*&lt;/AttributeValue&gt;<br>               &lt;AttributeDesignator AttributeId=&quot;urn:oasis:names:tc:xacml:1.0:resource:resource-id&quot; Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:resource&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>            &lt;/Match&gt;<br>         &lt;/AllOf&gt;<br>      &lt;/AnyOf&gt;<br>   &lt;/Target&gt;<br>   &lt;Rule Effect=&quot;Permit&quot; RuleId=&quot;Rule-1&quot;&gt;<br>      &lt;Target&gt;<br>         &lt;AnyOf&gt;<br>            &lt;AllOf&gt;<br>               &lt;Match MatchId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-regexp-match&quot;&gt;<br>                  &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;https?:\/\/[A-Za-z0-9@%._\+~#=-]+(\:[0-9]+)?\/API\/1.0.0\/subresource1&lt;/AttributeValue&gt;<br>                  &lt;AttributeDesignator AttributeId=&quot;urn:oasis:names:tc:xacml:1.0:resource:resource-id&quot; Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:resource&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>               &lt;/Match&gt;<br>            &lt;/AllOf&gt;<br>         &lt;/AnyOf&gt;<br>         &lt;AnyOf&gt;<br>            &lt;AllOf&gt;<br>               &lt;Match MatchId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-equal&quot;&gt;<br>                  &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;WRITE&lt;/AttributeValue&gt;<br>                  &lt;AttributeDesignator AttributeId=&quot;urn:oasis:names:tc:xacml:1.0:action:action-id&quot; Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:action&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>               &lt;/Match&gt;<br>            &lt;/AllOf&gt;<br>         &lt;/AnyOf&gt;<br>      &lt;/Target&gt;<br>      &lt;Condition&gt;<br>         &lt;Apply FunctionId=&quot;urn:oasis:names:tc:xacml:1.0:function:any-of&quot;&gt;<br>            &lt;Function FunctionId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-equal&quot;&gt;&lt;/Function&gt;<br>            &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;USER1&lt;/AttributeValue&gt;<br>            &lt;AttributeDesignator AttributeId=&quot;http://wso2.org/claims/username&quot; Category=&quot;urn:oasis:names:tc:xacml:1.0:subject-category:access-subject&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>         &lt;/Apply&gt;<br>      &lt;/Condition&gt;<br>   &lt;/Rule&gt;<br>   &lt;Rule Effect=&quot;Permit&quot; RuleId=&quot;Rule-2&quot;&gt;<br>      &lt;Target&gt;<br>         &lt;AnyOf&gt;<br>            &lt;AllOf&gt;<br>               &lt;Match MatchId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-regexp-match&quot;&gt;<br>                  &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;https?:\/\/[A-Za-z0-9@%._\+~#=-]+(\:[0-9]+)?\/API\/1.0.0\/subresource1&lt;/AttributeValue&gt;<br>                  &lt;AttributeDesignator AttributeId=&quot;urn:oasis:names:tc:xacml:1.0:resource:resource-id&quot; Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:resource&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>               &lt;/Match&gt;<br>            &lt;/AllOf&gt;<br>         &lt;/AnyOf&gt;<br>         &lt;AnyOf&gt;<br>            &lt;AllOf&gt;<br>               &lt;Match MatchId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-equal&quot;&gt;<br>                  &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;READ&lt;/AttributeValue&gt;<br>                  &lt;AttributeDesignator AttributeId=&quot;urn:oasis:names:tc:xacml:1.0:action:action-id&quot; Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:action&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>               &lt;/Match&gt;<br>            &lt;/AllOf&gt;<br>         &lt;/AnyOf&gt;<br>      &lt;/Target&gt;<br>      &lt;Condition&gt;<br>         &lt;Apply FunctionId=&quot;urn:oasis:names:tc:xacml:1.0:function:any-of&quot;&gt;<br>            &lt;Function FunctionId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-equal&quot;&gt;&lt;/Function&gt;<br>            &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;USER1&lt;/AttributeValue&gt;<br>            &lt;AttributeDesignator AttributeId=&quot;http://wso2.org/claims/username&quot; Category=&quot;urn:oasis:names:tc:xacml:1.0:subject-category:access-subject&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>         &lt;/Apply&gt;<br>      &lt;/Condition&gt;<br>   &lt;/Rule&gt;<br>   &lt;Rule Effect=&quot;Permit&quot; RuleId=&quot;Rule-3&quot;&gt;<br>      &lt;Target&gt;<br>         &lt;AnyOf&gt;<br>            &lt;AllOf&gt;<br>               &lt;Match MatchId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-regexp-match&quot;&gt;<br>                  &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;https?:\/\/[A-Za-z0-9@%._\+~#=-]+(\:[0-9]+)?\/API\/1.0.0\/subresource1&lt;/AttributeValue&gt;<br>                  &lt;AttributeDesignator AttributeId=&quot;urn:oasis:names:tc:xacml:1.0:resource:resource-id&quot; Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:resource&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>               &lt;/Match&gt;<br>            &lt;/AllOf&gt;<br>         &lt;/AnyOf&gt;<br>         &lt;AnyOf&gt;<br>            &lt;AllOf&gt;<br>               &lt;Match MatchId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-equal&quot;&gt;<br>                  &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;READ&lt;/AttributeValue&gt;<br>                  &lt;AttributeDesignator AttributeId=&quot;urn:oasis:names:tc:xacml:1.0:action:action-id&quot; Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:action&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>               &lt;/Match&gt;<br>            &lt;/AllOf&gt;<br>         &lt;/AnyOf&gt;<br>      &lt;/Target&gt;<br>      &lt;Condition&gt;<br>         &lt;Apply FunctionId=&quot;urn:oasis:names:tc:xacml:1.0:function:any-of&quot;&gt;<br>            &lt;Function FunctionId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-equal&quot;&gt;&lt;/Function&gt;<br>            &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;USER2&lt;/AttributeValue&gt;<br>            &lt;AttributeDesignator AttributeId=&quot;http://wso2.org/claims/username&quot; Category=&quot;urn:oasis:names:tc:xacml:1.0:subject-category:access-subject&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>         &lt;/Apply&gt;<br>      &lt;/Condition&gt;<br>   &lt;/Rule&gt;<br>&lt;Rule Effect=&quot;Permit&quot; RuleId=&quot;Rule-4&quot;&gt;<br>      &lt;Target&gt;<br>         &lt;AnyOf&gt;<br>            &lt;AllOf&gt;<br>               &lt;Match MatchId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-regexp-match&quot;&gt;<br>                  &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;https?:\/\/[A-Za-z0-9@%._\+~#=-]+(\:[0-9]+)?\/API\/1.0.0\/subresource2&lt;/AttributeValue&gt;<br>                  &lt;AttributeDesignator AttributeId=&quot;urn:oasis:names:tc:xacml:1.0:resource:resource-id&quot; Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:resource&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>               &lt;/Match&gt;<br>            &lt;/AllOf&gt;<br>         &lt;/AnyOf&gt;<br>         &lt;AnyOf&gt;<br>            &lt;AllOf&gt;<br>               &lt;Match MatchId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-equal&quot;&gt;<br>                  &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;READ&lt;/AttributeValue&gt;<br>                  &lt;AttributeDesignator AttributeId=&quot;urn:oasis:names:tc:xacml:1.0:action:action-id&quot; Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:action&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>               &lt;/Match&gt;<br>            &lt;/AllOf&gt;<br>         &lt;/AnyOf&gt;<br>      &lt;/Target&gt;<br>      &lt;Condition&gt;<br>         &lt;Apply FunctionId=&quot;urn:oasis:names:tc:xacml:1.0:function:any-of&quot;&gt;<br>            &lt;Function FunctionId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-equal&quot;&gt;&lt;/Function&gt;<br>            &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;USER2&lt;/AttributeValue&gt;<br>            &lt;AttributeDesignator AttributeId=&quot;http://wso2.org/claims/username&quot; Category=&quot;urn:oasis:names:tc:xacml:1.0:subject-category:access-subject&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>         &lt;/Apply&gt;<br>      &lt;/Condition&gt;<br>   &lt;/Rule&gt;<br>&lt;Rule Effect=&quot;Permit&quot; RuleId=&quot;Rule-5&quot;&gt;<br>      &lt;Target&gt;<br>         &lt;AnyOf&gt;<br>            &lt;AllOf&gt;<br>               &lt;Match MatchId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-regexp-match&quot;&gt;<br>                  &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;https?:\/\/[A-Za-z0-9@%._\+~#=-]+(\:[0-9]+)?\/API\/1.0.0\/subresource2&lt;/AttributeValue&gt;<br>                  &lt;AttributeDesignator AttributeId=&quot;urn:oasis:names:tc:xacml:1.0:resource:resource-id&quot; Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:resource&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>               &lt;/Match&gt;<br>            &lt;/AllOf&gt;<br>         &lt;/AnyOf&gt;<br>         &lt;AnyOf&gt;<br>            &lt;AllOf&gt;<br>               &lt;Match MatchId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-equal&quot;&gt;<br>                  &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;WRITE&lt;/AttributeValue&gt;<br>                  &lt;AttributeDesignator AttributeId=&quot;urn:oasis:names:tc:xacml:1.0:action:action-id&quot; Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:action&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>               &lt;/Match&gt;<br>            &lt;/AllOf&gt;<br>         &lt;/AnyOf&gt;<br>      &lt;/Target&gt;<br>      &lt;Condition&gt;<br>         &lt;Apply FunctionId=&quot;urn:oasis:names:tc:xacml:1.0:function:any-of&quot;&gt;<br>            &lt;Function FunctionId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-equal&quot;&gt;&lt;/Function&gt;<br>            &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;USER2&lt;/AttributeValue&gt;<br>            &lt;AttributeDesignator AttributeId=&quot;http://wso2.org/claims/username&quot; Category=&quot;urn:oasis:names:tc:xacml:1.0:subject-category:access-subject&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>         &lt;/Apply&gt;<br>      &lt;/Condition&gt;<br>   &lt;/Rule&gt;<br>&lt;Rule Effect=&quot;Permit&quot; RuleId=&quot;Rule-6&quot;&gt;<br>      &lt;Target&gt;<br>         &lt;AnyOf&gt;<br>            &lt;AllOf&gt;<br>               &lt;Match MatchId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-regexp-match&quot;&gt;<br>                  &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;https?:\/\/[A-Za-z0-9@%._\+~#=-]+(\:[0-9]+)?\/API\/1.0.0\/subresource2&lt;/AttributeValue&gt;<br>                  &lt;AttributeDesignator AttributeId=&quot;urn:oasis:names:tc:xacml:1.0:resource:resource-id&quot; Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:resource&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>               &lt;/Match&gt;<br>            &lt;/AllOf&gt;<br>         &lt;/AnyOf&gt;<br>         &lt;AnyOf&gt;<br>            &lt;AllOf&gt;<br>               &lt;Match MatchId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-equal&quot;&gt;<br>                  &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;READ&lt;/AttributeValue&gt;<br>                  &lt;AttributeDesignator AttributeId=&quot;urn:oasis:names:tc:xacml:1.0:action:action-id&quot; Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:action&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>               &lt;/Match&gt;<br>            &lt;/AllOf&gt;<br>         &lt;/AnyOf&gt;<br>      &lt;/Target&gt;<br>      &lt;Condition&gt;<br>         &lt;Apply FunctionId=&quot;urn:oasis:names:tc:xacml:1.0:function:any-of&quot;&gt;<br>            &lt;Function FunctionId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-equal&quot;&gt;&lt;/Function&gt;<br>            &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;USER1&lt;/AttributeValue&gt;<br>            &lt;AttributeDesignator AttributeId=&quot;http://wso2.org/claims/username&quot; Category=&quot;urn:oasis:names:tc:xacml:1.0:subject-category:access-subject&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>         &lt;/Apply&gt;<br>      &lt;/Condition&gt;<br>   &lt;/Rule&gt;<br>   &lt;Rule Effect=&quot;Deny&quot; RuleId=&quot;Rule-7&quot;&gt;<br>      &lt;Target&gt;<br>         &lt;AnyOf&gt;<br>            &lt;AllOf&gt;<br>               &lt;Match MatchId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-regexp-match&quot;&gt;<br>                  &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;https?:\/\/[A-Za-z0-9@%._\+~#=-]+(\:[0-9]+)?\/API\/1.0.0\/subresource1&lt;/AttributeValue&gt;<br>                  &lt;AttributeDesignator AttributeId=&quot;urn:oasis:names:tc:xacml:1.0:resource:resource-id&quot; Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:resource&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>               &lt;/Match&gt;<br>            &lt;/AllOf&gt;<br>         &lt;/AnyOf&gt;<br>         &lt;AnyOf&gt;<br>            &lt;AllOf&gt;<br>               &lt;Match MatchId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-equal&quot;&gt;<br>                  &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;WRITE&lt;/AttributeValue&gt;<br>                  &lt;AttributeDesignator AttributeId=&quot;urn:oasis:names:tc:xacml:1.0:action:action-id&quot; Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:action&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>               &lt;/Match&gt;<br>            &lt;/AllOf&gt;<br>         &lt;/AnyOf&gt;<br>      &lt;/Target&gt;<br>      &lt;Condition&gt;<br>         &lt;Apply FunctionId=&quot;urn:oasis:names:tc:xacml:1.0:function:any-of&quot;&gt;<br>            &lt;Function FunctionId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-equal&quot;&gt;&lt;/Function&gt;<br>            &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;USER2&lt;/AttributeValue&gt;<br>            &lt;AttributeDesignator AttributeId=&quot;http://wso2.org/claims/username&quot; Category=&quot;urn:oasis:names:tc:xacml:1.0:subject-category:access-subject&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>         &lt;/Apply&gt;<br>      &lt;/Condition&gt;<br>   &lt;/Rule&gt;<br>&lt;Rule Effect=&quot;Deny&quot; RuleId=&quot;Rule-8&quot;&gt;<br>      &lt;Target&gt;<br>         &lt;AnyOf&gt;<br>            &lt;AllOf&gt;<br>               &lt;Match MatchId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-regexp-match&quot;&gt;<br>                  &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;https?:\/\/[A-Za-z0-9@%._\+~#=-]+(\:[0-9]+)?\/API\/1.0.0\/subresource2&lt;/AttributeValue&gt;<br>                  &lt;AttributeDesignator AttributeId=&quot;urn:oasis:names:tc:xacml:1.0:resource:resource-id&quot; Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:resource&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>               &lt;/Match&gt;<br>            &lt;/AllOf&gt;<br>         &lt;/AnyOf&gt;<br>         &lt;AnyOf&gt;<br>            &lt;AllOf&gt;<br>               &lt;Match MatchId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-equal&quot;&gt;<br>                  &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;WRITE&lt;/AttributeValue&gt;<br>                  &lt;AttributeDesignator AttributeId=&quot;urn:oasis:names:tc:xacml:1.0:action:action-id&quot; Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:action&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>               &lt;/Match&gt;<br>            &lt;/AllOf&gt;<br>         &lt;/AnyOf&gt;<br>      &lt;/Target&gt;<br>      &lt;Condition&gt;<br>         &lt;Apply FunctionId=&quot;urn:oasis:names:tc:xacml:1.0:function:any-of&quot;&gt;<br>            &lt;Function FunctionId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-equal&quot;&gt;&lt;/Function&gt;<br>            &lt;AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;USER1&lt;/AttributeValue&gt;<br>            &lt;AttributeDesignator AttributeId=&quot;http://wso2.org/claims/username&quot; Category=&quot;urn:oasis:names:tc:xacml:1.0:subject-category:access-subject&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;<br>         &lt;/Apply&gt;<br>      &lt;/Condition&gt;<br>   &lt;/Rule&gt;<br>   &lt;Rule Effect=&quot;Deny&quot; RuleId=&quot;Deny-Rule&quot;&gt;&lt;/Rule&gt;<br>&lt;/Policy&gt;</pre><p>Please note that, you can change this sample XACML policy to make accessible for entries which are not in the active directory by changing the claim value (AttributeId=”<a href="http://wso2.org/claims/username">http://wso2.org/claims/username</a>&quot;) into ‘urn:oasis:names:tc:xacml:1.0:subject:subject-id’ which contains in the XACML request under the ‘AttributeId’ as follows.</p><pre>&lt;AttributeDesignator AttributeId=&quot;urn:oasis:names:tc:xacml:1.0:action:action-id&quot; Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:action&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;true&quot;&gt;&lt;/AttributeDesignator&gt;</pre><p>Hope this post will help you in writing customized XACML policies with complex resources. Let’s meet with the next post. :)</p><h4>References:</h4><ol><li><a href="http://docs.oasis-open.org/xacml/3.0/xacml-3.0-core-spec-os-en.html">http://docs.oasis-open.org/xacml/3.0/xacml-3.0-core-spec-os-en.html</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e56ed887793" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Calling Oracle Functions with User Defined Types (UDT), Using WSO2 Enterprise Integrator (EI)]]></title>
            <link>https://medium.com/@methmas/calling-oracle-functions-with-user-defined-types-udt-using-wso2-enterprise-integrator-ei-5b80658299bc?source=rss-8f19cbec3710------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b80658299bc</guid>
            <category><![CDATA[usdt]]></category>
            <category><![CDATA[ei]]></category>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[function]]></category>
            <category><![CDATA[oracle]]></category>
            <dc:creator><![CDATA[Methma Samaranayake]]></dc:creator>
            <pubDate>Tue, 05 Dec 2017 01:32:51 GMT</pubDate>
            <atom:updated>2017-12-05T03:28:37.856Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*2NXEf-4p-I545lhGiorE0w.jpeg" /><figcaption>Image source: <a href="https://wso2.com/">https://wso2.com/</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4pEGEkeHf2MlwmoFrqdekA.png" /><figcaption>Image source: <a href="https://www.oracle.com/">https://www.oracle.com/</a></figcaption></figure><p>As the first step, you have to connect WSO2 EI with your Oracle DB. For that download WSO2 EI from <a href="https://wso2.com/integration">here</a> and exact the product.</p><p>Then go to EI_HOME/conf/datasources/master-datasources.xml file. Edit and update with your information the WSO2_CARBON_DB inside &lt;datasources&gt; tag as follows.</p><blockquote><em>&lt;datasource&gt;<br> &lt;name&gt;WSO2_CARBON_DB&lt;/name&gt;<br> &lt;description&gt;The datasource used for registry and user manager&lt;/description&gt;<br> &lt;jndiConfig&gt;<br> &lt;name&gt;jdbc/WSO2CarbonDB&lt;/name&gt;<br> &lt;/jndiConfig&gt;<br> &lt;definition type=”RDBMS”&gt;<br> &lt;configuration&gt;<br> &lt;url&gt;jdbc:oracle:thin:</em><a href="http://twitter.com/192"><em>@</em></a><em>xxxx:1521/ora11g&lt;/url&gt;<br> &lt;username&gt;xxxx&lt;/username&gt;<br> &lt;password&gt;xxxx&lt;/password&gt;<br> &lt;driverClassName&gt;oracle.jdbc.driver.OracleDriver&lt;/driverClassName&gt;<br> &lt;maxActive&gt;50&lt;/maxActive&gt;<br> &lt;maxWait&gt;60000&lt;/maxWait&gt;<br> &lt;testOnBorrow&gt;true&lt;/testOnBorrow&gt;<br> &lt;validationQuery&gt;SELECT 1&lt;/validationQuery&gt;<br> &lt;validationInterval&gt;30000&lt;/validationInterval&gt;<br> &lt;defaultAutoCommit&gt;false&lt;/defaultAutoCommit&gt;<br> &lt;/configuration&gt;<br> &lt;/definition&gt;<br> &lt;/datasource&gt;</em></blockquote><p>Now lets set up the Oracle JDBC driver in to the EI. Copy the Oracle JDBC libraries (for example, &lt;ORACLE_HOME/jdbc/lib/ojdbc14.jar) to the &lt;EI_HOME/lib directory. Make sure you have removed the old database driver from the EI_HOME/dropins directory.</p><p>Create tables in the registry and user manager database (WSO2CARBON_DB), execute the EI_HOME/dbscripts/oracle.sql in your database.</p><p>Then you can start the server. (You can create database tables automatically <strong>when starting the product for the first time</strong> by using the -Dsetup as follows.</p><p>&lt;EI_HOME&gt;/bin/integrater.bat -Dsetup (Windows) &lt;EI_HOME&gt;/bin/integrator.sh -Dsetup (Linux)</p><p>Now it’s time to work with the Oracle function. You can do a UDT mapping inside the SQL query to use UDT as IN Params.</p><p>SQL DDL Scripts,</p><pre>CREATE OR REPLACE TYPE EmployeeName AS OBJECT(<br>First_Name VARCHAR2(100),<br>Last_Name VARCHAR2(100)<br>);<br>/<br>CREATE OR REPLACE TYPE EmployeeAddress AS OBJECT(                                            <br>Line1 VARCHAR2(100),<br>Line2 VARCHAR2(100),<br>City VARCHAR2(100),<br>Country VARCHAR2(100)<br>);<br>/<br>CREATE TABLE Employee(employeeId INTEGER, employeeName EmployeeName, employeeAddress EmployeeAddress);</pre><p>Sample function in Oracle DB.</p><pre>create or replace <br>FUNCTION employeeCountFunction(employeeId IN INTEGER, employeeName IN EmployeeName, employeeAddress IN EmployeeAddress) RETURN INTEGER<br>AS employeeCount INTEGER;<br>BEGIN<br>    INSERT INTO EMPLOYEE1 values(employeeId, employeeName,employeeAddress);<br>    SELECT COUNT(*) into employeeCount from EMPLOYEE1;<br>    RETURN employeeCount;<br>END;</pre><p>Now go to the management Console of WSO2 EI and create a Data Service. After the implementation, the Data Service would be look like this.</p><pre>&lt;data name=&quot;CallEmpCountFunctionService&quot; transports=&quot;http https local&quot;&gt;<br>   &lt;config enableOData=&quot;false&quot; id=&quot;OraDB&quot;&gt;<br>      &lt;property name=&quot;driverClassName&quot;&gt;oracle.jdbc.driver.OracleDriver&lt;/property&gt;<br>      &lt;property name=&quot;url&quot;&gt;jdbc:oracle:thin:@xxxx:1521/ora11g&lt;/property&gt;<br>      &lt;property name=&quot;username&quot;&gt;xxxxx&lt;/property&gt;<br>      &lt;property name=&quot;password&quot;&gt;xxxxx&lt;/property&gt;<br>   &lt;/config&gt;<br>   &lt;query id=&quot;CallEmployeeCountFunction&quot; useConfig=&quot;OraDB&quot;&gt;<br>      &lt;sql&gt;{call ?:=employeeCountFunction(?,EmployeeName(?,?),EmployeeAddress(?,?,?,?))}&lt;/sql&gt;<br>      &lt;result element=&quot;employee&quot; rowName=&quot;count&quot;&gt;<br>         &lt;element column=&quot;employeeCount&quot; name=&quot;employeeCount&quot; xsdType=&quot;integer&quot;/&gt;<br>      &lt;/result&gt;<br>      &lt;param name=&quot;employeeCount&quot; ordinal=&quot;1&quot; sqlType=&quot;INTEGER&quot; type=&quot;OUT&quot;/&gt;<br>      &lt;param name=&quot;employeeId&quot; ordinal=&quot;2&quot; sqlType=&quot;INTEGER&quot;/&gt;<br>      &lt;param name=&quot;First_Name&quot; ordinal=&quot;3&quot; sqlType=&quot;STRING&quot;/&gt;<br>      &lt;param name=&quot;Last_Name&quot; ordinal=&quot;4&quot; sqlType=&quot;STRING&quot;/&gt;<br>      &lt;param name=&quot;Address_Line1&quot; ordinal=&quot;5&quot; sqlType=&quot;STRING&quot;/&gt;<br>      &lt;param name=&quot;Address_Line2&quot; ordinal=&quot;6&quot; sqlType=&quot;STRING&quot;/&gt;<br>      &lt;param name=&quot;City&quot; ordinal=&quot;7&quot; sqlType=&quot;STRING&quot;/&gt;<br>      &lt;param name=&quot;Country&quot; ordinal=&quot;8&quot; sqlType=&quot;STRING&quot;/&gt;<br>   &lt;/query&gt;<br>   &lt;operation name=&quot;callEmpCountFuncOp&quot;&gt;<br>      &lt;call-query href=&quot;CallEmployeeCountFunction&quot;&gt;<br>         &lt;with-param name=&quot;employeeId&quot; query-param=&quot;employeeId&quot;/&gt;<br>         &lt;with-param name=&quot;First_Name&quot; query-param=&quot;First_Name&quot;/&gt;<br>         &lt;with-param name=&quot;Last_Name&quot; query-param=&quot;Last_Name&quot;/&gt;<br>         &lt;with-param name=&quot;Address_Line1&quot; query-param=&quot;Address_Line1&quot;/&gt;<br>         &lt;with-param name=&quot;Address_Line2&quot; query-param=&quot;Address_Line2&quot;/&gt;<br>         &lt;with-param name=&quot;City&quot; query-param=&quot;City&quot;/&gt;<br>         &lt;with-param name=&quot;Country&quot; query-param=&quot;Country&quot;/&gt;<br>      &lt;/call-query&gt;<br>   &lt;/operation&gt;<br>&lt;/data&gt;</pre><p><strong>Sources:</strong></p><p><a href="https://docs.wso2.com/display/EI611/Calling+MySQL+or+Oracle+Functions+in+a+Query#CallingMySQLorOracleFunctionsinaQuery-CallinganOraclefunction">Calling MySQL or Oracle Functions in a Query - Enterprise Integrator 6.1.1 - WSO2 Documentation</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b80658299bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>