Skip to Content
Author's profile photo Raj Thukiwakam

How to develop a JAVA Based adapter in PI

Step1: *Modifying the Java and Metadata Files*:


Change the file contents of all the files in sample_ra.jar,the sample_ra adapter’s java programs will be given a different adapter name and type, Package name, JNDI name, trace and log file locations, and the metadata describing the configuration parameters. So we will have to change them to our own package/path names.


            1.1   Change package name from to com.test. JMSMQMD.adapter.ra.

            1.2   Change package path for log and trace file locations from com/sap/aii/af/sample/adapter/ra                                             to com/test/zip/adapter/ra.

            1.3   Change adapter guid from to .

            1.4   Change adapter namespace from to .

            1.5   Rename the file from SampleRA.xml to ZipRA.xml.

            1.6   Create a java project in NWDS/Eclipse “AdapterZIP”.

            1.7   Create a package in the project: com.GSK.JMSMQMD.adapter.ra, copy ZipRA.xml into root of project directory and remaining files in to project directory, into sub-directory com/test/zip/adapter/ra.

            1.8    Change JNDI Name in Ra.xml from deployedAdapters/sample_ra/shareable/sample_ra to deployedAdapters/mqmd_ra/shareable/MQMD_ra,actually Ra.xml contains the metadata for the adapter, like  configuration parameters .

Step2:* *Modifying the Configuration Files for RAR* </p><p> </p><p>            2.1 In NWDS, create project AdapterYOURADAPTERNAME_RAR.</p><p class=”sapxdpparagraph”>            2.2 Extract and copy the META-INF directories to the appropriate project  directories.</p><p class=”sapxdpparagraph”>+                    2.2.1  +Change the namespace from to com.test.YourAdapterName.adapter.ra .<em> </em></p><p class=”sapxdpparagraph”>                    2.2.2 Change the adapter display file name references from sample_ra to YourAdapterName_ra. More information: Stand-Alone Deployment as RAR</p><p class=”sapxdpparagraph”>            2.3  Change the content of the ra.xml file. Change the adapter type from JCA to YOURADAPTERNAMEFile</p><p class=”sapxdpparagraph”>                     2.3.1  Change the adapter namespace from: to</p><p class=”sapxdpparagraph”>                     2.3.2  Change the adapter display name from sample_ra to YourAdapterName_ra. More information: Stand-Alone Deployment as RAR</p><p class=”sapxdpparagraph”>             2.4  Rename file from to com.test.YourAdapterName.adapter.ra-dd.xml. Verify that the reference in SAP_MANIFEST.MF has also been changed from to com.test.YourAdapterName.adapter.ra-dd.xml. (This should have already been done with step 3.1 above.) More information: Stand-Alone Deployment as RAR</p><p class=”sapxdpparagraph”>             2.5    Refresh the projects in NWDS.</p><p class=”sapxdpparagraph”> </p><p> </p><p>Step3: Creating and Deploying the Adapter.</p><p> </p><p class=”sapxdpparagraph”>                3.1 Create the RAR file and deploy it to the AS Java.</p><p class=”sapxdpparagraph”>                3.2 Load the adapter metadata.</p><p class=”sapxdpparagraph”>                       3.2.1 Load the metadata file, ra.xml, to PCK.</p><p class=”sapxdpparagraph”>             In a browser, enter URL http://<host>:<port>/CPACache/schemaupload.jsp.</p><p class=”sapxdpparagraph”>                   Enter the user ID and password when prompted.</p><p>                   Enter the following:</p><p class=”sapxdpparagraph”>                  The location of the YourAdapterNameRA.xml</p><p class=”sapxdpparagraph”>         Adapter type: YOURADAPTERNAMEFile</p><p class=”sapxdpparagraph”>         Adapter namespace:</p><p class=”sapxdpparagraph”>         Adapter version: 1.0</p><ol><li>Locate the YourAdapterNameRA.xml</li><li>Select Upload Adapter Metadata.</li></ol><p class=”sapxdpparagraph”>More information: Loading Adapter Metadata </p><p class=”sapxdpparagraph”>3.3 Verify the adapter.</p><p class=”sapxdpparagraph”> </p><p class=”sapxdpparagraph”>After deploying and loading the adapter metadata, the adapter is available in PCK. To verify the existence of the adapter, use the URL, http://<host>:<port>/pck/start/index.jsp and select Adapter Monitor. </p><p class=”sapxdpparagraph”> </p><p>Step4: Where to Add JAVA code.</p><p> </p><p>Sample_ra adapter have sample code and different JAVA classes</p><p>So If you are developing Sender Adapter then add your java code in SPIManagedConnectionFactory class file, Search and replace the method getOutFileName with the your code.</p><p> </p><p>In Case receiver adapter add java code in CCIInteraction class, Search and replace the method Send with the code.</p><p>    </p><p>Reference:</p><p> </p><p> *</p>

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Iliya Kuznetsov
      Iliya Kuznetsov

      What the way to build JAR with resources included?