Read input XML Payload in Mapping Program.

Hi all,
How can we access the input source XML structure in mapping program?
Please help me out in this?
Thanks and regards,
Kanth.

Hi,
yes - how else would we be able to manipulate it ? (map it?)
if you want the whole payload (in "string") for example
you need to use java or abap mappings
if I understand your question correctly
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Similar Messages

  • Reading A xml file and sending that XML Data as input  to a Service

    Hi All,
    I have a requirement to read(I am using File adapter to read) a xml file and map the data in that xml to a service(schema) input variable.
    Example of  xml file that I have to read and the content of that xml file like below:
      <StudentList>
        <student>
           <Name> ravi</Name>
           <branch>EEE</branch>
          <fathername> raghu</fathername>
        </student>
      <student>
           <Name> raju</Name>
           <branch>ECE</branch>
          <fathername> ravi</fathername>
        </student>
    <StudentList>
    I have to pass the data(ravi,EEE,raghu etc) to a service input varible. That invoked Service input variable(schema) contains the schema similar to above schema.
    My flow is like below:
      ReadFile file adapter -------------------> BPEL process -----> Target Service.I am using transform activity in BPEL process to map the data from xml file to Service.
    I am using above xml file as sample in Native Data format(to create XSD schema file).
    After I built the process,I checked file adapter polls the data and receive the file(I am getting View xml document in EM console flow).
    But transform activity does not have anything and it is not mapping the data.I am getting blank data in the transform activity with only element names like below
    ---------------------------------------------------------------------------EM console Audit trail (I am giving this because u can clearly understand what is happening-----------------------------------------------------
       -ReceiveFile
            -some datedetails      received file
              View XML document  (This xml contains data and structure like above  xml )
        - transformData:
            <payload>
              <InvokeService_inputvariable>
                  <part name="body">
                     <StudentList>
                         <student>
                           <name/>
                            <branch/>
                            <fathername/>
                         </student>
                   </StudentList>
              </part>
             </InvokeService_inputvariable>
    'Why I am getting like this".Is there any problem with native data format configuration.?
    Please help me out regarding this issue as I am running out my time.

    Hi syam,
    Thank you very much for your replies so far so that I have some progrees in my task.
    As you told I could have put default directory in composite.xml,but what happenes is the everyday new final subdirectory gets created  in the 'soafolder' folder.What I mean is in  the c:/soafolder/1234_xmlfiles folder, the '1234_xmlfiles' is not manually created one.It is created automatically by executing some jar.
    Basically we can't know the sub folder name until it is created by jar with its own logic. whereas main folder is same(soafolder) ever.
    I will give you example with our folder name so that it would be more convenient for us to understand.
    1) yesterday's  the folder structure :  'c:/soafolder/130731_LS' .The  '130731_LS' folder is created automatically by executing some jar file(it has its own logic to control and create the subdirectories which is not in our control).
    2) Today's folder structure :  'c:/soafolder/130804_LS. The folder is created automatically(everytime the number part(130731,130804).I think that number is indicating 2013 july 31 st like that.I have to enquire about this)is changing) at a particular time and xml files will be loaded in the folder.
    Our challenge : It is not that we can put the default or further path in composite.xml and poll the file adapter.Not everytime we have to change the path in composite.xml.The process should know the folder path (I don't know whether it is possible or not.) and  everyday and file adapter poll the files in that created subfolders.
    I hope you can understand my requirement .Please help me out in this regard.

  • Reading an invocation payload from BPEL

    Hi,
    I was wondering if anyone had successfully managed to read an XML payload from the BPEL dehydration store?
    I have a requirement to replay 4hrs of messages from BPEL in the event of a catastrophic failure on a subscribing system. I can't find any documentation on any out of the box functionality to do this.
    I know the payload of the messages are stored in the dehydration store in the table XML_DOCUMENT as BLOBs but I can't seem to read the data as a string.
    Im running the following query
    SELECT utl_raw.cast_to_varchar2(dbms_lob.substr(bin,5000,1)) FROM xml_document
    Does anybody have any ideas? or has anyone done anything similar?

    Hi,
    Got this from a colleague:
    create table instance_log
    cikey integer,
    detail_id integer,
    xml xmltype
    declare
    l_clob clob;
    l_dest_offset integer;
    l_src_offset integer;
    l_lang_context integer;
    l_warning integer;
    begin
    for r_ins in (select cikey,
    detail_id,
    utl_compress.lz_uncompress(bin) bin
    from audit_details
    where bin is not null
    loop
    l_dest_offset := 1;
    l_src_offset := 1;
    l_lang_context := dbms_lob.default_lang_ctx;
    dbms_lob.createtemporary(l_clob,true);
    dbms_lob.converttoclob
    ( dest_lob => l_clob,
    src_blob => r_ins.bin,
    amount => dbms_lob.getlength(r_ins.bin),
    dest_offset => l_dest_offset,
    src_offset => l_src_offset,
    blob_csid => 1,
    lang_context => l_lang_context,
    warning => l_warning
    insert into instance_log
    cikey,
    detail_id,
    xml
    values
    r_ins.cikey,
    r_ins.detail_id,
    xmltype(l_clob)
    end loop;
    commit;
    end;
    Apparently the row: utl_compress.lz_uncompress(bin) bin does do the trick.
    Keep in mind though that querying on this value (searching for instances based on data in this column) will result in full-table-scans.
    Regards,
    Martien

  • In PI how do I convert the XML payload (input) to a text file and send out

    I am extracting data from SAP and sending thru XI / PI to a file (non-sap system).
    On the receiving end, I need the file to be a text file, with one row for each "FTZ_Row concatenated_data" tag in the input.  It needs to be just a plain text file with no XML tags.
    Currently the file gets one record which matches exactly to the XML payload below.
    I want it to create a file that looks like this :
               CONCATENATED DATA 1
               CONCATENATED DATA 2
                012345678912345678MAKTX-TEST LB 123123123123 01/02/2009 Z001WCHA9876543210.12
    here is the payload going thru XI
      <?xml version="1.0" encoding="utf-8" ?>
    - <n0:FTZ_Concatenated_Row xmlns:n0="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone" xmlns:prx="urn:sap.com:proxy:FI0:/1SAI/TAS0C0412CDBC3E782D0219:700:2008/06/25">
      <FTZ_Row concatenated_data="CONCATENATED DATA 1" />
      <FTZ_Row concatenated_data="CONCATENATED DATA 2" />
      <FTZ_Row concatenated_data="012345678912345678MAKTX-TEST LB 123123123123 01/02/2009 Z001WCHA9876543210.12" />
      </n0:FTZ_Concatenated_Row>
    thanks
    jay

    thanks for the input but I am still having issues - I get an empty file when I use the content conversion option.
    My payload coming into XI is :
            <?xml version="1.0" encoding="utf-8" ?>
    - <n0:FTZ_Concatenated_Row xmlns:n0="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone" xmlns:prx="urn:sap.com:proxy:FI0:/1SAI/TAS0C0412CDBC3E782D0219:700:2008/06/25">
    <FTZ_Row concatenated_data="CONCATENATED DATA 1" />
    <FTZ_Row concatenated_data="CONCATENATED DATA 2" />
    <FTZ_Row concatenated_data="012345678912345678MAKTX-TEST LB 123123123123 01/02/2009 Z001WCHA9876543210.12" />
    </n0:FTZ_Concatenated_Row>
    Here is the layout of my data type - I am using the same for input & output
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone" targetNamespace="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone">
       <xsd:complexType name="FTZ_Concatenated_Row">
          <xsd:sequence>
             <xsd:element name="FTZ_Row" maxOccurs="unbounded">
                <xsd:complexType>
                   <xsd:attribute name="concatenated_data" type="xsd:string" />
                </xsd:complexType>
             </xsd:element>
          </xsd:sequence>
       </xsd:complexType>
    </xsd:schema>
    I mapped these items :  FTZ_Concatenated_Row & FTZ_Row & concatenated_data
    I set up my content convesion with :
      recordset structure   FTZ_Row
    FTZ_Row.fieldSeparator     #
    FTZ_Row.endSeparator     'nl'
    I am not sure why the following row looks like this ??
        <FTZ_Row concatenated_data="CONCATENATED DATA 1" />
    I thought FTZ_Row would be one tag and "concatenated_data" would be another one.
    any help would be appreciated.
    I have read many entries/blogs/etc in SDN but and tried many different setups, but nothing is working.
    thanks

  • Reading XML payload from text file

    Hello,
    I have a text file with XML payload in it. The text file has some header information and then the XML payload. How do I read only the XML payload for processing in PI?
    the structure of the text file is something like this..
    Header Information
    Payload
    Sample:
    #Datetime: 20140318-09:28:50.129
    #MessageID: sample123
    #Sender: TEST
    #SenderParty: TEST
    #ReceiverService:
    #ReceiverParty: Test
    #Interface: Test123
    #InterfaceNamespace: http://test.com
    <?xml version="1.0" encoding="UTF-8"?>
    <Sample ><Header>......
    Please advise.
    Thank you.
    Larry.

    package com.learning.utils;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.Reader;
    import com.sap.aii.mapping.api.AbstractTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.TransformationInput;
    import com.sap.aii.mapping.api.TransformationOutput;
    public class FetchPayload extends AbstractTransformation {
      String strData = null;
      @Override
      public void transform(TransformationInput arg0, TransformationOutput arg1)
      throws StreamTransformationException {
      // TODO Auto-generated method stub
      getTrace().addInfo("File Reading started ");
      String strData = convertStreamToString(arg0.getInputPayload()
      .getInputStream());
      getTrace().addInfo("File Reading successfully completed ");
      try {
      getTrace().addInfo("Generating XML started");
      strData.substring(strData.indexOf("<?xml"), strData.length());
      arg1.getOutputPayload().getOutputStream().write(
      strData.getBytes("UTF-8"));
      getTrace().addInfo("Generating XML started");
      } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      public String convertStreamToString(InputStream in) {
      StringBuffer sb = new StringBuffer();
      try {
      InputStreamReader isr = new InputStreamReader(in);
      Reader reader = new BufferedReader(isr);
      int ch;
      while ((ch = in.read()) > -1) {
      sb.append((char) ch);
      reader.close();
      } catch (Exception exception) {
      return sb.toString();
    and u can get  the xml as a resultant which  u can use as input for next message mapping.
    thanks and regards,
    Praveen T

  • Mapping complete input XML structure into one field on target

    Hi,
    I have a scenario where I need to map the complete input XML structure as it is, into one field on target side. so can we achieve this in Graphical Mapping? If yes, please share your valuable info.
    Regards,
    Shiva.

    Hello,
    this is the java map code.just compile it and made a .zip file import it and use it Interface Mapping.
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import java.util.Map;
    import java.io.*;
    public class PayloadToXMLField1 implements StreamTransformation {
        String strXML = new String();
       //Declare the XML tag for your XML message
       String StartXMLTag = "<DocumentBody>";
       String EndXMLTag = "</DocumentBody>";
       //String StartXMLTag1 = "<Code>";
       //String EndXMLTag1 = "</Code>";
        AbstractTrace trace;
        private Map param = null;
        public void setParameter(Map param) {
            this.param = param;
        public void execute(InputStream in, OutputStream out) {
            trace =
                (AbstractTrace) param.get(
                    StreamTransformationConstants.MAPPING_TRACE);
            trace.addInfo("Process Started");
            try {
                StringBuffer strbuffer = new StringBuffer();
                byte[] b = new byte[4096];
                for (int n;(n = in.read(b)) != -1;) {
                    strbuffer.append(new String(b, 0, n));
                strXML = strbuffer.toString();
            } catch (Exception e) {
                System.out.println("Exception Occurred");
            String outputPayload =
                StartXMLTag
             + "<![CDATA["
             + strXML
             + "]]>"
             + EndXMLTag;
            try {
                out.write(outputPayload.getBytes());
             trace.addInfo("Process Completed");;
            } catch (Exception e) {
                trace.addInfo("Process Terminated: Error in writing out payload");;

  • Query another message payload from graph mapping program

    Hi all,
    I have the following scenario
    Third Party Business System -> XI -> ECC 5.0
    Third Party sends ORDER to ECC and ECC answers with ORDRSP
    When mapping ORDRSP.ORDERS05 to Third Pty format, I need to use info that the Third Party provided us on the ORDERS.
    So... I have to query the ORDERS message payload from ORDRSP message mapping program.
    Any ideas?
    My first idea deal with doing an RFC lookup to search the ABAP Database for this info (my ABAP background raises ) but I'd like to know if there is a more elegant and efficent way of doing this.
    regards,
    David R.

    Hi,
    Let's try again to explain myself with my poor english!
    Time frame
    A) TPart system sends order. XI maps to ORDERS.ORDER05 idoc and is forwarded to ECC.
    B) In ECC users modify Sales order and then triggers the outbound ORDRSP.ORDERS05.
    C) XI has to map ORDRSP.ORDERS05 and include some info (in fact the original message) that was sent in step B).
    The xmls from TPart could be (simplified version):
    Orders (step A)
    <?xml version="1.0" encoding="iso-8859-1">
    <document>
      <header>
      </header>
      <Items>
      </Items>
      <Items>
      </Items>
      </Header>
    </Document>
    The received XML on step C) could be something like this:
    <?xml version="1.0" encoding="iso-8859-1">
    <Document>
      <PurchaseOrder_from_vendor>
      <i>Here I have to include the whole xml sent in step A</i>
      </PurchaseOrder_from_vendor>
      <SalesOrder_from_customer>
      <i>Here the ORDRSP.ORDERS05 mapping stuff</i>
      </SalesOrder_from_customer>
    </Document>
    All the communication will be always async.
    Any ideas?
    regards,
    David R.

  • Help converting or reading SOAP XML-attachment instead of payload

    Hi,
    I have to setup a webservice that excepts an xml-file as an attachment and read that xml-file as if it where the main payload of the message.
    The messages we receive holds all the data I need in the attachment instead of the data being in the SOAP-body itself. This isnt something I can change since this is a solution provided by amadeus e-travel and I have no chance of changing how they send data to us.
    I have searched and searched the forums but havent been able to find a solution(that I understand) to how I can access the xml-file either in a mapping-routine or by simply swapping the payload with the attachment all together.
    As of now I have a webservice that is functional and receives the call from the source(amadeus e-travel) without a problem. I can also see the attachment in SXMB_MONI where it looks like a perfect xml-structure. But I have no idea on how to access the attachment so that I can use the data inside it in an abap-proxy in our ECC-system.
    As far as I have read on the forums I cannot use the payloadswapbean in the SOAP senderadapter so that option is out. I have seen mention of a java-class for reading attachements in mapping-routines but sadly I'm not much of a Java-programmer and dont have access to one either at the moment. I would need a detailed explanation in order for a java-program to be a viable solution for me.
    Is there some trick I have missed here or blog that shows how to read xml-attachments in a soap-message?
    Is there any standard Java-code I can use to read the whole xml-structure from the attachment in a mapping-routine?
    Any help would be very much appreciated!
    Thanks in advance ,
    Halvor

    Option-1:
    This might be a crude way, but you can acheive by a 2 step process...
    Step1 (Scenario-1) - Receive XML-Msg + Attachment using SOAP Sender adapter. As we have payloadwaapbean module limitation in sender adapter. Let it be a passthru to receiver SOAP adapter. (Don't do any processing in integration engine, like msg mapping or thything). In Rx SOAP adapter,use payloadswapbean to swap XML msg with Payload and resent it to 2nd integration scenario...
    Step2(Scenario-2) - As you have the Attachment as main-payload, you can continue ur normal msg processing on it.
    Option2:
    SOAP messages can also be processed using AXIS-SOAP Adapter.. you can add XI module in it Check it if it might help you...
    http://help.sap.com/saphelp_nw04/helpdata/EN/45/a4a36de28552f7e10000000a1553f7/content.htm
    Regards,
    Siva Maranani

  • How to read XML payload in Adapter module

    Hi all,
    I have to read content of xml payload inside custom adapter module:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_REQ xmlns:ns0="namespace">
    <record>
      <EmployeeName>a</EmployeeName>
      <EmployeeID>9999</EmployeeID>
      </record>
    <record>
      <EmployeeName>b</EmployeeName>
      <EmployeeID>9999</EmployeeID>
      </record>
    <record>
      <EmployeeName>c</EmployeeName>
      <EmployeeID>9999</EmployeeID>
      </record>
      </ns0:MT__REQ>
    obj = inputModuleData.getPrincipalData();
    msg = (Message) obj;
    XMLPayload xpld = msg.getDocument();
    String xmltxt = xpld.getText();
    InputStream in = new ByteArrayInputStream(xmltxt.getBytes("UTF-8"));
    & then using DOM parser i am trying to read the contents.
    But i am not able to read anything. And no exception is raised.
    How can i read contents of this xml file.
    Thanks,
    Mayank

    hi,
    I am still getting same Blank payload.
    My Code for Parsing is:
    doc = db.parse((InputStream) xpld.getInputStream());
    NodeList list_Set=doc.getElementsByTagName("record");
    NodeList list_Set1=doc.getElementsByTagName("EmployeeName");
    NodeList list_Set2=doc.getElementsByTagName("EmployeeID");
    Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "12");
    String input = "";
    for(int i = 0; i < list_Set.getLength(); i++){
    Node f=list_Set1.item(i);
    f=f.getFirstChild();
    String str_f=f.getNodeValue();
    Node f2=list_Set2.item(i);
    f2=f2.getFirstChild();
      String str_f2=f2.getNodeValue();
    input = input + str_f + "," + str_f2 +  "END" ;
    Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Value added from incoming payload");
    Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, input);
    And in RWB monitoring, i am able to see:
    2009-10-01 14:20:51 Information 12
    2009-10-01 14:20:51 Information UNDEFINED
    2009-10-01 14:20:51 Information 14
    So UNDEFINED is coming for input.
    Edited by: Mayank  Gupta on Oct 1, 2009 11:08 AM

  • Read an XML file into an ABAP program and manipulate it.

    I would like to know if it is possible to do the following in an ABAP program:
    1) Read an XML file into an ABAP internal table
    2) Call an XSLT transformation on the source file and store the results in an ABAP table.
    Is this possible to do? I have used ABAP XSLT in PI, but never in an ABAP program. I see you can use the CALL TRANSFORMATION command, but I have never used it in an ABAP program.
    Kind Regards,
    Tony.

    Check out these blogs.
    XML DOM Processing in ABAP part I -  Convert an ABAP table into XML file using SAP DOM Approach.
    XML DOM Processing in ABAP part II - Convert an XML file into an ABAP table using SAP DOM Approach.

  • XML Payload to Transaction Input

    Hi,
    For clarification, used to be (and still appears to be) that for transaction input properties, data type needed to be 'simple' (ie: string etc), and although we can have transaction input properties of type XML, they still appear in the WSDL as string.  Although I can see that this works fine even if the string content is actually XML, and the inbound data (which in fact is XML as a string) still looks like XML in the transaction, is this still the recommended approach?  Or is there another recommended way to get an XML payload passed in to a transaction using Runner / SOAPRunner from an external application.
    Additionally, when calling the Runner (or SOAPRunner) from an external application, is there then any limit to the length of the URI call?  I know that browsers have limits on the path, but here we're playing with a path + query string outside of browsers? 
    Are there any limitations on the Netweaver side?
    By the way, currently using MII V12.2.2
    Regards
    Kevin.

    Hi Kevin,
    You can pass XML as string to a transaction and make input parameter as XML in transaction.
    That is perfectly fine.
    As far as I know about the limit of URL, It depends on the server.
    However there are two methods to call a http webservice. GET and POST.
    Use the POST method which is having more limit than GET method. I have faced issue with GET on high volume of data so replaced it with POST method. I have used the url with query parameters of a few MB's (approx 4-5) and never faced the limit issue with POST. You can check exact limit with some load testing on the server.
    Thanks
    Anshul

  • Testing XML Payload of Message Mapping in RWB

    Hi All,
    Is there any way where we can test the XML payload of Message Mapping bypassing the usual testing of messages thorugh IE .
    What i mean here is passing tge XML payload of Message Mapping directlyy to Adapter Engine...
    Regards
    Vinay P.

    Hi Vinay
    As said above
    You can use Testing the Runtime feature to do this task
    RWB -> Component Monitoring -> Integration engine Test tab
    You can also use this feature for Adapter engine and J2SE adapter - File & JDBC
    http://help.sap.com/saphelp_nw70/helpdata/EN/33/b99eebd9261b4886d6f6a354b8dcdf/content.htm
    Follow michal blog give above for screen shots
    Thanks
    Gaurav

  • How to pass input parameter (parameterized mapping) to java mapping program

    Hello
    I have a question about the parameterized mapping with Java (PI 7.1).
    In the operation mapping (using Java-class) I defined a inputer parameter (string). I think I am supposed to retrieved the value using:
                    arg0.getInputParameters().getString("myInputParameterName");
    where arg0 is the TransformationInput object.
    However I am not able to get the value, I got runtime exception saying the inputer parameter doesn't exit.
    Then I figured out maybe I need to bind the OM input parameter to Java mapping parameter, just like in case of message mapping, you need to bind OM parameter to MM parameter. However there is no way to define input parameter for the java mapping program.
    Anybody has done java mapping with parameterized mapping?
    Anybody can give any hint for this?
    Thanks
    Jayson

    InputParameters params = container.getInputParameters();
    DynamicConfiguration conf = (DynamicConfiguration) params.getValue(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Directory");
    http://help.sap.com/saphelp_nwpi71/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
    Edited by: Anand on Dec 10, 2008 4:13 PM

  • Read Inbound payload at mapping execution of the outbound interface

    Hi,
    The sap system is sending us a field, that is not avaible on the web service we are consuming.
    The problem is that the sap system requires this field at the responce.
    How can I read the inbound payload, when I'm mapping the outbound responce?
    Thanks in advance,
    A

    Hi!
    Thanks for your responce.
    Well, I will ignore solutions 1 and 3. The project has an a "must" not tu use BPM and is not possible to modify the web service due it's a closed system (legal issues).
    And regarding the second point, are you proposing to create an RFC on the sap system?, The problem is that is not possible to reconstruct the relationship between the responce and the sended message. That is why I need to read the outbound payload.
    Is there any walkaround to "export" this field at the outbound mapping (Context objects?) and then import it at the inbound mapping? Where are the messages stored?... I was thinking that maybe i'll be able to read the sended message using ABAP mapping,  using the msgid to read an ABAP table (dont know which one). Can this be done?
    Thanks again,
    A

  • Error in Java Mapping program

    Hi friends,
    I am tryin java mapping for first time.. and created one java program using link https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/wholePayloadtoaXML+field
    But when I am compiling it using JAVAC, I am getting following error message that
    package com.sap.aii.mapping.api does not exist . How can I solve this error.
    Complete error is as follows:
    C:j2sdk1.4.2_16-x64 in>javac PayloadToXMLField.java
    PayloadToXMLField.java:1: package com.sap.aii.mapping.api does not exist
    import com.sap.aii.mapping.api.StreamTransformation;
                                   ^
    PayloadToXMLField.java:2: package com.sap.aii.mapping.api does not exist
    import com.sap.aii.mapping.api.AbstractTrace;
                                   ^
    PayloadToXMLField.java:3: package com.sap.aii.mapping.api does not exist
    import com.sap.aii.mapping.api.StreamTransformationConstants;
                                   ^
    PayloadToXMLField.java:8: cannot resolve symbol
    symbol  : class StreamTransformation
    location: class PayloadToXMLField
    public class PayloadToXMLField implements StreamTransformation {
                                              ^
    PayloadToXMLField.java:16: cannot resolve symbol
    symbol  : class AbstractTrace
    location: class PayloadToXMLField
        AbstractTrace trace;
        ^
    PayloadToXMLField.java:27: cannot resolve symbol
    symbol  : class AbstractTrace
    location: class PayloadToXMLField
                (AbstractTrace) param.get(
                 ^
    PayloadToXMLField.java:28: cannot resolve symbol
    symbol  : variable StreamTransformationConstants
    location: class PayloadToXMLField
                    StreamTransformationConstants.MAPPING_TRACE);
                    ^
    PayloadToXMLField.java:43: cannot resolve symbol
    symbol  : variable outputPayload
    location: class PayloadToXMLField
            outputPayload =
            ^
    PayloadToXMLField.java:50: cannot resolve symbol
    symbol  : variable outputPayload
    location: class PayloadToXMLField
                out.write(outputPayload.getBytes());
                          ^
    9 errors
    Thanks,
    Brijesh Soni

    thanks , it is done now..
    the program is compiled properly and class file is generated.
    but m gettin error in mapping.
    in IR i created two message type  with data type as string.
    and i had imported the class file and java program using Imported archives.
    now in interface mapping mapping program i had selected type as Java Class.and name of java program.
    but when i tested it, it is giving error as Linkage error occurred when loading class zip/PayloadToXMLField
    Please suggest, M i doing some thing wrong?is any thing missing?
    Program tht i had used in java
    from link (https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/wholePayloadtoaXML+field):
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import java.util.Map;
    import java.io.*;
    public class PayloadToXMLField implements StreamTransformation {
        String strXML = new String();
        String outputPayload = new String();
         //Declare the XML tag for your XML message
         String StartXMLTag = "<Payload>";
         String EndXMLTag = "</Payload>";
        AbstractTrace trace;
        private Map param = null;
        public void setParameter(Map param) {
            this.param = param;
        public void execute(InputStream in, OutputStream out) {
            trace =
                (AbstractTrace) param.get(
                    StreamTransformationConstants.MAPPING_TRACE);
            trace.addInfo("Process Started");
            try {
                StringBuffer strbuffer = new StringBuffer();
                byte[] b = new byte[4096];
                for (int n;(n = in.read(b)) != -1;) {
                    strbuffer.append(new String(b, 0, n));
                strXML = strbuffer.toString();
            } catch (Exception e) {
                System.out.println("Exception Occurred");
            outputPayload =
                "<?xml version="1.0" encoding="UTF-8"?>"
                   + StartXMLTag
                   + strXML
                   + EndXMLTag;
            try {
                out.write(outputPayload.getBytes());
                   trace.addInfo("Process Completed");;
            } catch (Exception e) {
                trace.addInfo("Process Terminated: Error in writing out payload");;
    and detailed trace of error is:
    11:34:21 Start of test
    LinkageError at JavaMapping.load(): Could not load class: zip/PayloadToXMLField
    java.lang.NoClassDefFoundError: zip/PayloadToXMLField (wrong name: PayloadToXMLField) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.lang.ClassLoader.defineClass(ClassLoader.java:448) at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingLoader.findClass(RepMappingLoader.java:175) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at com.sap.aii.ibrep.server.mapping.ibrun.RepJavaMapping.load(RepJavaMapping.java:136) at com.sap.aii.ibrep.server.mapping.ibrun.RepJavaMapping.execute(RepJavaMapping.java:50) at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingHandler.run(RepMappingHandler.java:80) at com.sap.aii.ibrep.server.mapping.rt.MappingHandlerAdapter.run(MappingHandlerAdapter.java:107) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInterfaceMapping(ServerMapService.java:127) at com.sap.aii.ibrep.server.mapping.ServerMapService.transform(ServerMapService.java:104) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.transform(MapServiceBean.java:40) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0.transform(MapServiceRemoteObjectImpl0_0.java:167) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0p4_Skel.dispatch(MapServiceRemoteObjectImpl0_0p4_Skel.java:104) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:319) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:200) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:136) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    11:34:21 End of test

Maybe you are looking for

  • PSE5 on Win 7: newly installed .8bf files not appearing in Filters menu [was: Good Day,]

    Good Day, I  am running PSE5 under Windows 7 64-bit, I have tried numerous times to get newly installed 8bf files to show up in the program  under filters, but this never happens. The additional filters such as Flaming Pear 'Flood' were correctly cop

  • Email body formatting

    Grretings Forum, I need some help in sending a mail with proper format. My text message is a report. Therefore I want them to be lined up. When see in the debug message it is all lined up. But when the mail is actually sent the message is not lined u

  • Status Bar In form 6i

    hi all, i want to use 6i developer status bar to show username and date or some other information at the bottom of the form. i'm using 6i on client server enviroment thanks Shakeel

  • ME2N & MC$0

    Hi, I am trying to do some Purchase Value analysis, purchase group wise. I tried two routes one via ME2N (Got POs for a P Grp for the financial year) > EKPO table (got effective value for the PO nos for undeleted items, for the same period). And the

  • Position search event subscribe

    Hi all. Note 1112733 specifies the namespace and event of the employee search iView for subscription by custom iViews. Event namespace: urn:com.sap.mss.employeesearch Event name: selection_changed I am looking for something similar to subsribe to the