Get fields of XML structure  in abap mapping

Hi,
I have next structure:
get_next( ).
  endwhile.
But it returns all fields of a node: all fields of EAN or all fields of LIN in a string without structure.
How can I get each value of codigo, ean, desc ?
Thanks, in advance.
Carme

HI,
Can u please go through the below odf for help.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
Thnx
Chirag
Reward points if it helps.

Similar Messages

  • File to IDoc : XML parsing in ABAP mapping

    Hi,
    In ABAP mapping I want to parse all of the incoming XML strings to internal table.Later I add few more fields to this table and transfer them to IDOC adapter in IDOC-XML format.In thsi case how do i get all of the input file data(converted from XML) into internal table using XML parsing in ABAP Mapping?
    Thansk in advance,
    RP

    Hi Amil,
    I insert into table but not immediately,I want all the parsed xml data into internal table and do something before I insert into DB /send it to IDOC.
    I knwo how to get single Xml parsing,but how to get multple records(looping xml parse) to internal table?
    Thanks,
    RP
    Edited by: RP@261 on Jun 3, 2009 2:14 PM

  • Getting XML info with ABAP mapping

    Hi everyone.
    I'm near to finish my abap mapping demo. The problem is that i don't know how i can retrieve the values of a kind of node.
    I would like to retrieve this data into a internal table. I've done the output XML.
    How can i get that values from SOURCE parameter into an internal table?
    Regards.

    Hi!
    First of all you have a little bit of XML parsing to do using the SIXML package in ABAP (see example reports in same dev class).
    Then you can travers your "document" with methods like
    get_elements_by_tag_name or get_root_element.
    There are also 2 function modules to convert a document into an ABAP internal table.
    SDIXML_DATA_TO_DOM and SDIXML_DOM_TO_DATA.
    Regards
    Michael

  • More fields in XML structure error in Adapter Monitor

    Hi all
    I am getting the following error in the adapter monitor
    Error: Message processing failed: Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'java.lang.Exception: Consistency error: more fields found in XML structure than specified in conversion parameters! (Value ' ')', probably configuration error in file adapter (XML parser error)'
    I am using FCC in the rx adapter. I have also checked the fields for any extra fields but there isnt any.
    kindly suggest what could be throwing the error
    regards
    krishna

    Hi raj
    here are the CC parameters.
    BEGIN.addHeaderLine     0
    BEGIN.fieldFixedLengths     2,1,3,2,4,1,8,12,8,2,307,12,8,12,18
    BEGIN.fixedLengthTooShortHandling     Ignore
    BEGIN.endSeparator     '0x0D''0x0A'
    CLIENT_RECORD.addHeaderLine     0
    CLIENT_RECORD.fieldFixedLengths     2,12,9,4,15,15,4,20,12,9,8,1,1,25,10,1,25,10,1,6,1,1,1,1,1,10,8,1,25,2,1,1,1,106,12,38
    CLIENT_RECORD.fixedLengthTooShortHandling     Ignore
    CLIENT_RECORD.endSeparator     '0x0D''0x0A'
    RELATION_RECORD.addHeaderLine     0
    RELATION_RECORD.fieldFixedLengths     2,12,9,4,20,20,2,2,9,8,1,25,10,1,25,10,1,6,1,1,181,12,38
    RELATION_RECORD.fixedLengthTooShortHandling     Ignore
    RELATION_RECORD.endSeparator     '0x0D''0x0A'
    ADDRESS_RECORD.addHeaderLine     0
    ADDRESS_RECORD.fieldFixedLengths     2,12,9,4,20,20,2,2,5,6,8,24,24,2,35,15,4,15,4,70,8,8,1,50,12,38
    ADDRESS_RECORD.fixedLengthTooShortHandling     Ignore
    ADDRESS_RECORD.endSeparator     '0x0D''0x0A'
    GIVING_REC.addHeaderLine     0
    GIVING_REC.fieldFixedLengths     2,12,9,4,20,9,1,1,1,1,1,1,1,1,1,1,1,1,1,281,12,38
    GIVING_REC.fixedLengthTooShortHandling     Ignore
    GIVING_REC.endSeparator     '0x0D''0x0A'
    ZIKT_REC.addHeaderLine     0
    ZIKT_REC.fieldFixedLengths     2,12,9,4,20,9,2,3,2,8,1,1,277,12,38
    ZIKT_REC.fixedLengthTooShortHandling     Ignore
    ZIKT_REC.endSeparator     '0x0D''0x0A'
    BEPER_REC.addHeaderLine     0
    BEPER_REC.fieldFixedLengths     2,12,9,4,20,9,1,1,1,291,12,38
    BEPER_REC.fixedLengthTooShortHandling     Cut
    BEPER_REC.endSeparator     '0x0D''0x0A'
    SCORE_BEPER_REC.addHeaderLine     0
    SCORE_BEPER_REC.fieldFixedLengths     2,12,9,4,20,9,1,3,4,1,1,284,12,38
    SCORE_BEPER_REC.fixedLengthTooShortHandling     Ignore
    SCORE_BEPER_REC.endSeparator     '0x0D''0x0A'
    INDBES_REC.addHeaderLine     0
    INDBES_REC.fieldFixedLengths     2,12,9,4,20,9,9,2,2,8,8,8,1,256,12,38
    INDBES_REC.fixedLengthTooShortHandling     Ignore
    INDBES_REC.endSeparator     '0x0D''0x0A'
    FUNCTIONAL_REC.addHeaderLine     0
    FUNCTIONAL_REC.fieldFixedLengths     2,12,9,4,20,9,9,3,2,8,8,8,1,4,2,2,1,1,1,1,8,1,1,233,12,38
    FUNCTIONAL_REC.fixedLengthTooShortHandling     Ignore
    FUNCTIONAL_REC.endSeparator     '0x0D''0x0A'
    ACT_REC.addHeaderLine     0
    ACT_REC.fieldFixedLengths     2,12,9,4,20,9,9,3,2,8,3,5,1,263,12,38
    ACT_REC.fixedLengthTooShortHandling     Ignore
    ACT_REC.endSeparator     '0x0D''0x0A'
    SCORE_REC.addHeaderLine     0
    SCORE_REC.fieldFixedLengths     2,12,9,4,20,9,3,4,1,1,285,12,38
    SCORE_REC.fixedLengthTooShortHandling     Ignore
    SCORE_REC.endSeparator     '0x0D''0x0A'
    ZFUNCTIONAL_REC.addHeaderLine     0
    ZFUNCTIONAL_REC.fieldFixedLengths     2,12,9,4,20,9,9,12,3,2,8,8,5,1,8,8,8,4,2,2,1,1,1,1,210,12,38
    ZFUNCTIONAL_REC.fixedLengthTooShortHandling     Ignore
    ZFUNCTIONAL_REC.endSeparator     '0x0D''0x0A'
    ZACT_REC.addHeaderLine     0
    ZACT_REC.fieldFixedLengths     2,12,9,4,20,9,9,3,2,3,5,8,8,5,8,1,242,12,38
    ZACT_REC.fixedLengthTooShortHandling     Ignore
    ZACT_REC.endSeparator     '0x0D''0x0A'
    COMMENT.addHeaderLine     0
    COMMENT.fieldFixedLengths     2,12,4,140,1,191,12,38
    COMMENT.fixedLengthTooShortHandling     Ignore
    COMMENT.endSeparator     '0x0D''0x0A'
    END_REC.addHeaderLine     0
    END_REC.fieldFixedLengths     2,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,1,257,50
    END_REC.fixedLengthTooShortHandling     Ignore
    END_REC.endSeparator     '0x0D''0x0A'
    REgards
    krishna

  • Checking Well-Formed XML files with ABAP Mapping

    Hi guys,
    Anybody knows which is the best way to check (well-formed) incoming XML files trough XI?
    I’m using ABAP Mapping and before I check the value of the XML fields I want to check if the XML is well-formed. For this reason I need to know which is the class or classes that I need to use to checking the format of XML using an XSD file?
    That is also possible using a DTD file instead of XSD?
    Which is better XSD or DTD?
    Thanks in advance,
    Ricardo.

    Hi Ricardo,
      try out these links.
    /people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping
    /people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi
    /people/sap.user72/blog/2003/09/18/xsl-and-abap
    Thanks and Regards
    Vishal Kumar

  • Deleting XML element in ABAP mapping

    hi All
    I Have I huge xml filen that has to go to an Idoc , but I only want to use the header data.
    is there a way of deleting the unwanted xml elements and their children elements in ABAP mapping.
    Thanks.

    Hi Ravi and all
    Actually I did as you said, but I get this error.
    <Trace level="1" type="T">com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException:
    XMLParser: Prefix 'ns1' is not mapped to a namespace(:main:, row:177, col:25)
    This position 177 , is the element that is not needed , so I thought if I can delete it , I can get rid of this error and move forward.
    May be you have antoher suggestion to get rid of this error.
    Thank you.

  • Get Message ID and namespace from ABAP Mapping

    Hi XI Expert,
    Please advise how to get the message ID and namespace from ABAP Mapping.
    Thank You and best Regards
    Fernand

    Hi,
    To access the message ID, use the method GET_MESSAGE_ID of the controller object:
           1.      Fetch a protocol instance for the protocol IF_WSPROTOCOL_MESSAGE_ID.
           2.      To have the system return the message ID after the sender has sent a request message or the receiver has received a request message, use the method GET_MESSAGE_ID of this instance. This returns the ID by using the parameter MESSAGE_ID of type SXMSGUID.
    Also you could do the same by this way also:
    IF_WSPROTOCOL_XI_HEADER
    has attributes messageid and interface namespace.
    using this  you can read the XI message header

  • Abap mapping code

    Hi friends
    I am new to Abap mapping PLZ can any one helpme on abap mapping code
    with Source structure and target structure
    Message was edited by:
            Viswanadh Vadde

    Hi !!
    refer the below links
    BAP Mapping is used whenever you explicitly need to build your output XML structure . Its entirely depends on your call which approach you want to adopt i.e. JAVA mapping or ABAP mapping as in both the cases you need to explicitly build the output structure . ABAP Mapping however creates a DOM tree in the memory . Therefore it can be a performance issue whenever your source structure is complex . In case you need an idea of how to go about ABAP mapping here is a link which you can refer
    http://help.sap.com/saphelp_nw04/helpdata/en/47/b5413acdb62f70e10000000a114084/frameset.htm
    Also ABAP mappings have the handicap that they are separated from usual development in Repository. Additional there is more (ABAP, DOM) experience required as for example for XSLT or graphical mapping (my point of view). So they are used for special reasons like access to ABAP stack (transparent tables!).
    Refer to following SDN Demo which explains the need and how to do the ABAP mapping.
    https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/110ff05d-0501-0010-a19d-958247c9f798#jdi [original link is broken] [original link is broken] [original link is broken]
    Comparing Performance of Mapping Programs
    /people/udo.martens/blog/2006/08/23/comparing-performance-of-mapping-programs
    ABAP Mapping Blogs
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e3ead790-0201-0010-64bb-9e4d67a466b4
    /people/sameer.shadab/blog/2005/09/29/testing-abap-mapping
    How to Use ABAP Mapping
    https://wwwn.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    Some more
    ABAP Mapping
    I suggest you also go through these links to know more on ABAP Mapping:
    https://websmp101.sap-ag.de/~sapdownload/011000358700003082332004E/HowToABAPMapping.pdf
    /people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi
    /people/r.eijpe/blog
    ABAP Mapping Vs Java Mapping.
    Re: Message Mapping of type ABAP Class not being shown
    Refer to following SDN Demo which explains the need and how to do the ABAP mapping.
    https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/110ff05d-0501-0010-a19d-958247c9f798#jdi [original link is broken] [original link is broken] [original link is broken]
    This document will help you to create ABAP Mapping.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/3.0/how%20to%20use%20abap-mapping%20in%20xi%203.0.pdf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    /people/sameer.shadab/blog/2005/09/29/testing-abap-mapping
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    /people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping
    why Abap Mapping and how to acheive it
    https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/110ff05d-0501-0010-a19d-958247c9f798#jdi [original link is broken] [original link is broken] [original link is broken]
    <b>Pls reward if useful</b>

  • ABAP mapping  constraints/restrictions ?

    what are the  ABAP mapping  constraints/restrictions? Please answer its urgent.

    vinod ,
    constrains are basically
    1) ABAP mapping are very complex....
    2)generally ppl go for ABAP mapping  when its not possible to do the mapping dwith graphical,java or XSLT.
    3) there is no ABAP mapping editor in XI
    4) u have to import the ABAP mapping in IR..then u can use it in Interface mapping.
    ABAP Mapping is used whenever you explicitly need to build your output XML structure . Its entirely depends on your call which approach you want to adopt i.e. JAVA mapping or ABAP mapping as in both the cases you need to explicitly build the output structure . ABAP Mapping however creates a DOM tree in the memory . Therefore it can be a performance issue whenever your source structure is complex . In case you need an idea of how to go about ABAP mapping here is a link which you can refer
    http://help.sap.com/saphelp_nw04/helpdata/en/47/b5413acdb62f70e10000000a114084/frameset.htm
    Also ABAP mappings have the handicap that they are separated from usual development in Repository. Additional there is more (ABAP, DOM) experience required as for example for XSLT or graphical mapping (my point of view). So they are used for special reasons like access to ABAP stack (transparent tables!).
    Refer this Pdf
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e3ead790-0201-0010-64bb-9e4d67a466b4
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/110ff05d-0501-0010-a19d-958247c9f798#jdi [original link is broken]
    And these Blog also
    /people/sameer.shadab/blog/2005/09/29/testing-abap-mapping
    /people/ricardoandres.maienza/blog/2007/04/06/how-to-call-xi-abap-mapping-via-rfc
    u can achieve value mapping using ABAP mapping..
    see here..
    ABAP Mapping with Value Mapping
    u can have a look
    Using ABAP XSLT Extensions for XI Mapping
    /people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping
    regards
    biplab
    Use a Good Subject Line, One Question Per Posting - Award Points

  • How to write a log using abap mapping

    Hi all.
    in PI 7.1 environment I need to use abap mapping and I wish to write some XML data into a table that I created for logging the data.
    I know that using the abap mapping I can parse an XML file. My question is how to write this table defining a specific method, if it is necessary.
    Any help or suggestion is well appreciated.
    Many thanks in advance for your kind cooperation.
    Regards,
      Giovanni

    hi,
    >> My question is how to write this table defining a specific method, if it is necessary.
    just like to normal table (insert statement)
    parse XML and get the data you need and just insert into the DB table
    there are many tutorials showing how to parse xml file inside abap mapping
    so just do a little search on sdn
    Regards,
    Michal Krawczyk

  • Creating a PDF-Mail-Attachment via Abap Mapping possible ?

    Hi folks,
    I am trying to build a szenario like: Getting an Idoc -> sending it to abap mapping -> map a pdf from smartforms in abap -> map the from/to for the mail payload -> come back from abap mapping -> send it with the mail adapter .
    But now I am stuck at the point "coming back from abap mapping", because the pdf -data seems to become unreadable because of conversion. I am using Ixml and trying to attach the create pdf (looks hex-right at that point) by method create_simple_element as content-tag of the mail. But after rendering and coming back out of mapping, it seams that that data is not converted from xstring back in the right way. Can someone give a hint ? Is that way by IXML not possible for data including binary-data ? Have I to go another way?
    Thanks in advance
    Detlef

    > as content-tag of the mail.
    Sometimes I have to read the request several times to find the issue:
    No you cannot put a binary as part of an XML element.
    You can only send a plain binary as payload, so the whole mail would be nothing besides the PDF.
    In PI 7.1 you can create also an additional attachment out of mapping, but I do not know if this works for ABAP mapping also.
    The whole "I want to send an email with attachment out of PI" topic is not supported from PI development in any way.
    So you have to write a lot of code (especially Java code) to achieve this.
    > Regarding your opinion. Its based on customer requirements to have central focal point in dezentral landscape.
    The PI expert has to advise the customer for the scenarios. That is part of the job.

  • Adding a node in ABAP Mapping

    Hello All,
    I need to create the follwoing structure using ABAP mapping
    <IDocFlatFile>
       <FlatFile>
          <FlatFileString/>
       </FlatFile>
    </IDocFlatFile>
    With the follwoing code
    data irc type i.
    data: odocument type ref to if_ixml_document.
    odocument = ixmlfactory->create_document( ).
    data: IDocFlatFile type ref to if_ixml_element.
    IDocFlatFile = odocument->create_simple_element(
    name = 'IDocFlatFile'
    parent = odocument ).
    data: fileString type ref to if_ixml_element.
    fileString = odocument->create_simple_element(
    name = 'FlatFileString'
    value = t_result
    parent = IDocFlatFile ).
    I am able to generate the
    <IDocFlatFile>
          <FlatFileString/>
    </IDocFlatFile>
    But I want to add one more level (<FlatFile>
    ) in the structure. Can any one help me in doing the same.

    Nanda,
    I think you are tyring to convert IDOC into IDOC Flat file. If yes then please check this document:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a
    Also you can send the IDoc to a flat file, creating a type file port. If you send the IDoc in this way, you have the complete idoc in the flat file. If you want like this please see this thread (Kanth solution):
    How to read an IDOC flat file and send it to XI
    Regards,
    ---Satish

  • OSB Service callout losing fault info xml structure

    Hi there
    I have a proxy service (getAccount) that being called via service callout by getBilling.proxy service.
    getAccount throws a fault message that I want to catch in getBilling.
    But the original fault from getAccount somehow get lost the xml structure in the detail node. The "<" sign change into "&lt;"
    Am I missing something here. How the xml structure get lost in the detail node ?
    Here's the output:
    <soapenv:Body>
      <soapenv:Fault>
      <faultcode>soapenv:Server</faultcode>
      <faultstring>BEA-382502: OSB Service Callout action received an error response</faultstring>
      <detail>
         <con:fault xmlns:con="http://www.bea.com/wli/sb/context">
         <con:errorCode>BEA-382502</con:errorCode>
         <con:reason>OSB Service Callout action received an error response</con:reason>
        <con:details>
           <con1:ErrorResponseDetail xmlns:con1="http://www.bea.com/wli/sb/stages/transform/config">
           <con1:detail>
              &lt;ipms:fault xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ipms="http://www.indosat.com/ipms">
              &lt;ipms:faultcode>IPMS-5000&lt;/ipms:faultcode>
              &lt;ipms:faultstring>Account Not Found&lt;/ipms:faultstring>
              &lt;ipms:faultlocation>
              &lt;ipms:faultsource>/billing-stream/proxy/getAccount&lt;/ipms:faultsource>
             &lt;ipms:faultnode>RouteTo_getAccountByMsisdn_db&lt;/ipms:faultnode>
        &lt;ipms:faultpath>response-pipeline&lt;/ipms:faultpath>
      &lt;/ipms:faultlocation>
      &lt;ipms:detail>
        &lt;con:errorCode xmlns:con="http://www.bea.com/wli/sb/context">IPMS-5000&lt;/con:errorCode>
        &lt;con:reason xmlns:con="http://www.bea.com/wli/sb/context">Account Not Found&lt;/con:reason>
        &lt;con:location xmlns:con="http://www.bea.com/wli/sb/context">
          &lt;con:node>RouteTo_getAccountByMsisdn_db&lt;/con:node>
          &lt;con:path>response-pipeline&lt;/con:path>
        &lt;/con:location>
      &lt;/ipms:detail>
    &lt;/ipms:fault>
      </con1:detail>
      </con1:ErrorResponseDetail>
      </con:details>
      <con:location>
      <con:node>PipelinePairNode1</con:node>
      <con:pipeline>PipelinePairNode1_request</con:pipeline>
      <con:stage>stage1</con:stage>
      <con:path>request-pipeline</con:path>
      </con:location>
      </con:fault>
      </detail>
      </soapenv:Fault>
    </soapenv:Body>

    What's the content-type in the HTTP 500 response from the backend service? (not OSB proxy, but the original source of the fault)
    I suspect it is text/plain or just missing. OSB doesn't know it is XML, and so it escapes it.
    Vlad

  • Fetch entire xml structure

    Hi,
    I am looking for a way to get the entire xml structure inside an actual xml object, or if possible, as a string. I need to pass it to a service but i haven't found a way to get it in the layout that it is shown in the structure panel. The only thing i am able to do is work with XMLElments but isnt there any other way to access it?

    if its importing then you can import the xml into javascript rather than indesign then manipulate the xml before placing it in indesign.
    for example, in this case the xml is read from a file into javascript:
    var xmlFile = File.openDialog ("Please select the XML file");
    xmlFile.open("r");
                        var strXML = xmlFile.read();
      xmlFile.close();
                        XML.ignoreComments = true;
                        XML.ignoreProcessingInstructions = true;
    xmlTree =  new XML(strXML);
    var childrenXML = XMLTree.children(); // children would be directly below the root element to select individual elements use .child("elementName") there are several other options available for navigating through the nodes: including: .parent() and also descendants().
    for (i =0;i < XMLTree.children().length; i++) {
    //process the xml
    Keith

  • 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");;

Maybe you are looking for