Adapter Module to convert text message to XML

Hello Experts,
I am writing a custom adapter module to convert the text  content to XML message at the sender adapter end.
I have followed the steps mentioned in the "HowToCreateModulesforJ2EEAdapterEngine" guide available on SDN.
I have created the java logic in the process mesthod of the bean to conver the text message to XML paylod (don't know if it is correct). I do not have much idea about the Adpater API methods.
Can anybody help me with the logic to convert the text msg to xml paylod using adapter frame work APIs or is there any way I can debug and test my logic in NWDS.
Any help will be greatly appreciated.
- Rajan

Hi ,
To convert Text message to XML why yiu want to go for Adapter Module?? Using file content conversion it self you can do it right?????
There is no standard logic to convert text file to XML, the logic purely depends on your text message format.
Regards,
Raj

Similar Messages

  • How to write adapter module to convert the xml to pdf file

    Hi all,
      how to write adapter module to convert the xml to pdf file.
    Please any body assist step by step procedure.

    PI 7.1 XML to PDF transformation
    have you seen below links:
    http://forums.sdn.sap.com/thread.jspa?threadID=1212478
    http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/14363

  • Is there an app to convert text messages to email in order to print a thread?

    I need to be able to print my text message thread.   Is there an app that will convert my texts to emails?

    txtot is finnally avaliable for download again
    here's the direct link
    or simply visit txtot.com
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.
    <Edited by Host>

  • How to convert text file into xml file format with and check that with DTD

    I have an text file with | seperator . I have to convert this to an xml file and check with DTD present with me..
    plz help me out

    can i get some code that how to compare the xml with dtd or just give the DTD name with an XML

  • Is there any function module for converting text to hyperlink?

    Hello all,
              I am designing an application in BSP wherein the user can enter hypertext values for some
              of the data enteries in the database table. Is there any function module available for converting
              text into hypertext. Eg. if the user enters 'www.mypersonalwp.com' then it should convert this
              text value into a hyperlink.
    Thanks in advance.
    Gurmahima.

    Hi,
    Refer the given below link
    http://help.sap.com/saphelp_erp2004/helpdata/EN/85/ce25c2d7ae11d3b56d006094192fe3/content.htm
    Hope it helps you
    Thanks
    Arun Kayal

  • Why does my iphone often convert text messages to photo messages?

    When I send messages to an ordinary cell phone, they sometimes go through as photo messages even though I have not touched the camera icon next to the text window.  When I intentionally send a photo message, my phone asks me if I want to take a new photo or use one from my camera roll.  This question isn't asked when I type a normal text message, but it often is received as a photo message even though there is no photo.

    It more than likely has to do with the carrier that the person you are texting.
    I have friends that I text who receive mine as MMS instead of SMS.
    Nothing that you can do as your sending it normally.
    The person your texting will need to ask their carrier.

  • Converting IDOC messages into XML in SAP

    Dear experts,
    I wanted to know how one can setup that the IDOC messages in the SAP can be converted into XML file.
    I have a programme and have tested this seems to work, however, I need to know where exactly should i implement this, after the IDOC has been created and then needs to be converted into XML structure.
    The information I already have found in the forum and programme also, but dont have a very clear methodology to do this.
    Any information or tips or tricks could be useful.
    Br,

    Just Create an XML File Port ( In WE21 ).
    Provide path of the application server in Directory Field.Use function module from F4 help for file naming Conventions.
    in outbound trigger tab,mention the RFC destination which starts the program RFCEXEC on application server.

  • Program to convert text(Idoc) to XML

    Hi
    Can some1 give me the name of this program.
    I know it exists in SAP

    Hi,
    function module IDOC_XML_FROM_FILE to convert XML to IDOC
    In general source Idoc, target Idoc Xml XSD take .
    and map it, so it will be easy to do in XI.
    With Business Connector see the below links
    WAS - Business Connector
    business connector documentation
    SAP Business Connector
    Business connector
    Will Business Connector 4.6 be affected by new  Daylight savings changes
    Business connector
    More info on XI can be found at https://service.sap.com/xi
    and webAS on http://help.sap.com/saphelp_nw04/helpdata/en/f3/e20f3adfd0a706e10000000a114084/frameset.htm
    Check this also-
    http://help.sap.com/saphelp_nw2004s/helpdata/en/6f/1bd5c2a85b11d6b28500508b5d5211/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b4f3755a-0401-0010-b6b3-9b65bb7d4503
    Reward points if useful..
    Regards
    Nilesh

  • Converting text String to XML file data

    need some guidance. I have to create a XML file of a huge Text File.
    I am parsing the text file according to relevance and passing a set of data each element and attribute seperated by "_".
    I need to create to Xml file out this. It has to be current process as I need to keep on adding new elements and attributes.
    e.g.
    Passing this string
    String temp("Name_Age_Birthdate_Birthplace_Place_teleNumber");
    Need to add this to XML of format
    <Directory>
    <Person>
    <Name>
    <Age>
    <Birthdate>.....
    </Person>
    <Person>
    </Person>
    </Directory>
    The problem not all attributes may be present at some time..
    e.g.
    the person's age may be absent some times.. during that time the xml file should look like <Age/>
    I will need to keep on updating Person list concurrently after the file has been created..
    Need Urgent guidance.. I am still New to java
    A guidance code or link is awaited..
    Thanks.. a Lot

    Do you need to stick to the XML support that comes with Java 1.4 or can you use Third-Party stuff? I'm asking, 'cause I think JDOM is much easier to use for a newbie than the build-in XML API ... and it comes with a VERY easy to use class XMLOutputter that creates XML files!
    Take a look at JDOM:
    http://www.jdom.org/

  • How to convert text file into xml file

    Hi Folks,
    I am genarating list of data into text file, but i want to genarate xml file for this text file. How to achive this , please let me know. Thanks.
    regards
    Vishal

    hi Vishal,
      Use<b> GUI_DOWNLOAD</b> FM and give the file name as <b>file.xml</b> with BIN Mode....
    i.e,
      Download internal table to presentation server file(PC)
      DATA: ld_filename TYPE string value <b>file.xml</b>,
    Pre version 4.7 declaration e_file like rlgrap-filename.
      DATA: begin of it_datatab occurs 0,
      row(500) type c,
    end of it_datatab.
      call function 'GUI_DOWNLOAD'
           exporting
                filename         = ld_filename
                <b>filetype         = 'BIN'</b>
           tables
                data_tab         = it_datatab[]
           exceptions
                file_open_error  = 1
                file_write_error = 2
                others           = 3.
    Regards,
    Santosh

  • How should convert text file into XML file?

    I do a project "WEB SERVER LOG ANALYZER" using JSP. For that i copy the content of log file into the other file . how i convert it into XML file . xplain with coding

    Read this [page.|http://www.devx.com/getHelpOn/10MinuteSolution/20356]

  • Urgent Help to convert text file to XML

    I have a text file containing data. The file has following format:
    Name               : ABC Consultants
    Address               : B50, 5th Street,
                   Sector 70,
                   Salt Lake
                   Calcutta-700048
    Contact Person          : Mr. Sanjay Ghosh
    Designation          : Senior Consultant
    Phone No.          : 033-373575
    Fax               : 033-374590 Extn. 06
    E-mail               : [email protected]
    Website               : www.abc.com
    Nature of Business     : HR consultancy
    Cities of Operation     : All over India & Abroad
    Other Information     : Company specialises in providing top executives to MNCs and corporate giants like IBM, Oracle and Microsoft.
    There is information regarding other companies in the similar way.
    The objective is to create a XML file out of this text file by proper tagging like
    <name> company name comes here </name>
    <address> company address comes here </address>
    ..so on
    My approach:
    I am trying to read from the text file and store the contents into a vector object. Then I would use the vector object to create different nodes of the XML file through JDOM.
    My vector object is getting created but when I am writing it back , it is giving garbage value.
    Is my approach correct ..Please Suggest..
    Thanks in advance..
    Nilotpal

    Following is the code, which i have written. I am writing the contents to another text file - "output.txt"
    <CODE>
    try{
         // Open an input stream
    BufferedReader inputData = new BufferedReader(new FileReader("companyList.txt"));
    String buffer = null;
    while ((buffer = inputData.readLine()) != null)
         {StringTokenizer words = new StringTokenizer(buffer, ":;");
    Object[] lineData = new Object[words.countTokens()];
    int counter = 0;
    while(words.hasMoreTokens())
         {lineData[counter] = words.nextToken();
    counter++;
    data.addElement(lineData);
    Object[] obArrayData = new Object[data.size()];
    for(int i=0; i<data.size(); i++)
         {     obArrayData[i] = (Object[]) data.elementAt(i);}
    //write to a text file
    FileWriter fw = new FileWriter("C:\\Projects\\com\\gayatrii\\convertor\\output.txt");
    for(int i = 0; i < data.size(); i ++)
    fw.write(data.elementAt(i).toString()+" \n");
    fw.close();
    </CODE>

  • Without using Seeburger Adapter can we convert EDI 864 TC to XML

    Hello Friends,
                            Can we convert 864 Transaction code (Text Message) to XML with out an External adapter like Seeburger Adapter? I mean can we write a code in JAVA for conversion? If so, what should i use in that Java code?

    Hi
    These blog can help u....
    /people/bla.suranyi/blog/2006/06/08/sap-xi-supports-edifact
    /people/srinivas.vanamala2/blog/2006/12/11/edi-basics
    Already discussed thread:
    EDI Conversion
    Re: Seeburger Splitter adapter!!
    Regards
    Santhosh
    Remember to set the thread to solved when you have received a solution

  • How to convert CARGO - IMP FWB, FHL and FFM message in xml with BizTalk

    Dear Friend's
    I need convert CIMP message to xml using biztalk,
    Can you help me?
    Thanks

    Hi ,
        In BizTalk Administration, expand BizTalk Application. Right-click Receive Ports, click New and then click One-way Receive Port.
        Enter a Name for the receive port. For example, enter EDIReceivePort.
        Click Receive Locations and then click New. Enter the following:
            Name: Enter a name for the receive location. For example, enter EDIReceiveLocation.
            Type: Click FILE.
            Receive pipeline: Click EdiReceive.
        Click the Configurebutton and enter the following:
            Receive folder: Browse to the folder storing the EDI message.
            File mask: Change to *.txt
        Click OK to close the windows.
        Right-click Send Ports, click New, click Static One-way Send Port. Enter the following:
            Name: Enter a name for the send port. For example, enter EDISendPort.
            Type: Click FILE.
            Send pipeline: Click PassThruTransmit.
        Click the Configure button and enter the following:
            Receive folder: Browse to the folder storing the EDI message.
            File mask: Keep the default value.
        Click OK to close the window.
        Click Filtersand enter the following filter:
        BTS.ReceivePortName == EDIReceivePort
        Click OK to close the window.
    When complete, drop the EDI 850 text message into the FILE receive location. The FILE send port location should contain a MessageID.xml file.
    Thanks
    Abhishek

  • PI 7.1 Adapter Module Development - Identify SOAP Fault Message

    Hi Experts,</br>
    here's a PI 7.1 Adapter Module Development issue I hope you can help me to resolve. It's about identifying SOAP fault messages.</br>
    </br>
    Scenario at a glance:</br>
    Adapter Modules placed in the modules chain at request and response time in a synchronous Scenario:</br>
    - Request: SOAP Axis to RFC </br>
    - Response and Fault Response: RFC to SOAP Axis</br>
    </br>
    The issue is how to identify SOAP fault message in SOAP Axis Adapter Module in the response message:</br>
    The client gets SOAP fault messages like the follwong one:</br>
       <SOAP:Body>
          <SOAP:Fault>
             <faultcode>SOAP:Server</faultcode>
             <faultstring>Server Error</faultstring>
             <detail>
                <ns1:exception xmlns:ns1="http://typen.geschaeftsstelle.pab.barmer.de">
                   <ns1:errortext>bla bla bla ...</ns1:errortext>
                </ns1:exception>
             </detail>
          </SOAP:Fault>
       </SOAP:Body>
    </br>
    </br>
    But when trying to access the tags faultcode and/or faultstring in the adapter module via xPath expressions I do not get them. Obviously the SOAP Fault tags are built AFTER the adapter module has been passed. So my question is:</br>
    How can I clearly/uniquely detect a SOAP fault response message (and distinguish it from a "normal" response message) in my SOAP Axis Adapter Module?</br>
    </br>
    I tried it the following way:</br>
    </br>
    </br>
    // Check Message Payload for SOAP Fault Message via xPath expressions</br>
    ...</br>
    // SOAP Fault Code</br>
    zv_xPression = zc_constXPattern.replaceFirst("&", "faultcode");</br>
    zv_soapFaultCode = XPathAPI.eval(zv_doc, (String) zv_xPression).toString();</br>
    // SOAP Fault String</br>
    zv_xPression = zc_constXPattern.replaceFirst("&", "faultstring");</br>
    zv_soapFaultString = XPathAPI.eval(zv_doc, (String) zv_xPression).toString();</br>
    // check for SOAP Fault Message</br>
    if (zv_soapFaultCode.equals("") && zv_soapFaultString.equals("")) {</br>
         // Create Audit Log entry - NOT a SOAP Fault Message</br>
         zv_msgText = zc_constModuleName + " 0190: xPath - OK! This message is NOT a SOAP Fault Message";</br>
         zv_audit.addAuditLogEntry(zv_msgKey, AuditLogStatus.SUCCESS, zv_msgText);</br>
         zv_faultCheck = false;</br>
    }</br>
    else {</br>
         ...</br>
         // Create Audit Log entry - SOAP Fault Message</br>
         zv_msgText = zc_constModuleName </br>
              + " 0200: xPath - this message is a SOAP Fault Message. " </br>
              + " - Faultcode is: " + zv_soapFaultCode </br>
              + " - Faultstring is: " + zv_soapFaultString; </br>
         zv_audit.addAuditLogEntry(zv_msgKey, AuditLogStatus.ERROR, zv_msgText);</br>
         ...</br>
    }</br>
    ...</br>
    </br></br>
    But zv_soapFaultCode and zv_soapFaultString are always empty (with other payload tags this coding works fine).</br>
    </br>
    Any ideas? </br></br>
    Thanx very much in advance!</br></br>
    Regards,</br>
    Volker

    Hi Alex!
    Like already mentioned I solved my problem by identifying the SOAP exception with the messageClass attribute of the PI message header. Acess code:
    try {
    String zv_msgClass = zv_piMsg.getMessageClass().toString();
    } catch (Exception e) {
    zv_msgText = zc_constModuleName
    + " E0110: Message processing terminated."
    + " Reason: Error while getting MessageClass "
    + zv_dataSource
    + e;
    // create trace and audit log entry (severity ERROR) for exception
    zv_location.errorT(ZV_SIGNATURE, zv_msgText);
    zv_audit.addAuditLogEntry(zv_msgKey, AuditLogStatus.ERROR, zv_msgText);
    ModuleException me = new ModuleException(e);
    zv_location.throwing(ZV_SIGNATURE, me);
    e.printStackTrace();
    throw me;
    }     // end of try-catch-block
    But I do not think this will solve your problem. I am almost sure, that something in your Axis configuration is wrong/missing. If a handler cannot be instatiated then it really may be missing. Have a look at defaultTrace.trc. Maybe you will find more suitable information about the root cause of your problem. Also have a look at NWA under software components and/or application modules if you can find/see your modules.
    But there is a general issue when trying to catch PI fault messages. If e.g. the requestor tries to login with wrong userid/pasword, then you will have no chance to catch this kind of error - at least as far as I know. Because in this very early stage of PI message processing no module is called.
    One last question: Did you develop your own Adapter or just an adapter module? In the first case: Is your adapter started and healthy? Have a look at RWB -> communication channel monitoring.
    Regards,
    Volker

Maybe you are looking for