How to access Payload in XI Adapter Module

Hello,
I have to enhance a adapter module in xi very urgently. Target is to access a node of the XML payload and retrieve the corresponding value.
This is how my document looks like:
<mt_test>
     <element1>
          <…> </…>
     </element1>
     <element2>
          <LOG_NO>4711 </LOG_NO>
     <element2>
</mt_test>
I need now access the element <LOG_NO>. This can only appear one time in the whole xml document. My code that I did so far (inside the process method) to retrieve this element is like this:
XMLPayload xmlpayload = msg.getDocument();
     DocumentBuilderFactory factory = null;     
     factory = DocumentBuilderFactory.newInstance();
     DocumentBuilder builder = factory.newDocumentBuilder();
     Document document = builder.parse ((InputStream)xmlpayload.getInputStream());
     Element rootNode = document.getDocumentElement();
<…and now I have no clue anymore…:-/…>
May you give me an example how to access the node <LOG_NO> and save the corresponding value in a String variable?
I would be really thankful.
Greetings and thanks in advance,
Tobias

Hi,
>>>found no solution with PI Standard Import to support FTP inside the Adapter Module
why would you? file adapter supports FTP - so you don't need it
>>>In order to use FTP library, is there any standard library available or supported by SUN.
you can use any java ftp client available on google
Regards,
Michal Krawczyk

Similar Messages

  • How to access FTP server through Adapter Module

    I gone through SDN Search and found no solution with PI Standard Import to support FTP inside the Adapter Module
    Requirement
    This is File to IDoc Scenario.
    I am trying to write Module which takes care of processing 50MB to 100MB file and split based on conditions of the record structure of the file. Where we are trying to reduce the file size and takes care of certain logic by eliminating/building xml etc...while splitting file.
    In order to use FTP library, is there any standard library available or supported by SUN.
    Please advice

    Hi,
    >>>found no solution with PI Standard Import to support FTP inside the Adapter Module
    why would you? file adapter supports FTP - so you don't need it
    >>>In order to use FTP library, is there any standard library available or supported by SUN.
    you can use any java ftp client available on google
    Regards,
    Michal Krawczyk

  • How to get file name in adapter module

    Hi all
    Is it possible to get the file name in a adapte module? If so how can I achieve this?

    Hi,
    Check below thread. it shows code for file name.
    [Re: Query regarding Adapter Module development]
    -Gouri

  • How do i know whether my adapter module is working or not?

    Hi
    I have written one Adapter Module and i have given that module in Communcation Channel.
    1.How do i know whether my module is working or not.
    2.How do i atleast my adpater module is calling or not?
    Please help me its very urgent
    Best Regards
    Ravi Shankar B

    Hi Ravi Shankar,
    Since u had written the module, u must have deployed the module on the adapter engine. Now follow this procedure:
    1. Set the breakpoint on the "process" method of ur java code.
    2. Put ur code into Debugging mode.
    3. Place the file again and try running ur scenario
    If the executuin stops at the method "process", then this means that ur module is getting called and there is some error in ur code.
    If the execution is not stopped there, then that means ur module is not visible to XI adapter engine. So either it is not properly deployed or there is some problem while developing it.
    Regards,
    Prateek

  • How to access attachement in mail adapter

    Hello,
    i receive mails with an xml file attached with the mail adapter. Within the integration engine i can see that the adapter creates a message with two parts in the payload "MailAttachement-1" and "MailMessage". When i configure a file writer for my message i only get the content of the "MailMessgage" part (which contains only the sender, subject, mailtext ... and not the data i need (= "MailAttachement-1")). I tried several settings within the mail adapter configuration (user Mail Package, keep Attachements) -> no success.
    How can i get access to the "MailAttachement-1" within the mapping?
    Thanks
    Peter

    Hi,
    If you want only the header data of the file (expecting you are having other data also) then it is not possible to do so without mapping. What I would suggest is to do the mapping for header and use this in ID.
    So configure two receivers one for mail and another with file. In the receiver determination for the mail you use mapping and for file you dont use mapping at all. This would resolve your issue.
    Regards,
    ---Satish

  • How to access ProcessForm data from adapter

    Hi
    I am writing new CreateUser adapter, i have added "ProcessInstanceKey", and able to get the value into my adapter code. But how I can get OIM values (like firstname, lastname email address etc.. ) and ProcessForm values.
    If you can provide sample code, it will help a lot.
    thanks in Advance
    Jaipal.

    Hi,
    One more.
    I have added FirstName, LastName attributes in Adapter Factory Task Parameters window. As well as my Adapter Java code contains method called
    createMethodPK(long processInstanceKey, String firstName, String lastName)
    with above code, I am able to get processinstancekey, firstname and lastname into Java code.
    My question is, my create method needs around 10+ attributes from the form. Is there any way, I can get form attributes using ProcessInstanceKey? without adding in the Task parameter window? So that I can avoid adding all attributes into my method signature?
    thanks

  • 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

  • How to get the sent date in Adapter Module

    Hi
    How to get Sent Date in Adapter Module. I have used message.getSentTime(). But i am getting in 1179051733406 format is there any way to change this format.
    Is there any other way to get the date when file sending.?
    Is it possible to get Soap Header data Run Time xml file elements (<SAP:Date>) in SXMB_MONI into my Adapter Module.
    Please Help Me
    Best Regards
    Ravi Shankar B

    Is it possible to get Soap Header data Run Time xml file elements (<SAP:Date>) in SXMB_MONI into my Adapter Module.?
    Hi ravi, if you enable Adapter specific Message Attributes in your Adapter CC,(Source File TimeStamp), you can access the same in your ADapter code as a dynamic configuration
    Regards
    krishna

  • How to Send Appointment via mail adapter

    Hi Guys,
         I need to send the appointment and vTodo via mail adapter, any way i need to develop a mail adapter module. Till now i have finished this part,and i can send normal mail even normal mail with attachment. But i don't know how to send appointment via mail adapter.
    This is payload content of appointment which got from Exchange server to gmail:
    _=_NextPart_001_01C71EC0.97A011C6
    Content-Type: text/plain;
        charset="GB2312"
    Content-Transfer-Encoding: quoted-printable
    When: 2007=C4=EA6=D4=C227=C8=D5=D0=C7=C6=DA=C8=FD 3:30 =CF=C2=CE=E7-4:00 = =CF=C2=CE=E7 (GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi.
    Where: China
    ~*~*~**
    This is calendar content
    _=_NextPart_001_01C71EC0.97A011C6
    Content-class: urn:content-classes:calendarmessage
    Content-Type: text/calendar;
        method=REQUEST;
        name="meeting.ics"
    Content-Transfer-Encoding: 8bit
    BEGIN:VCALENDAR
    METHOD:REQUEST
    PRODID:Microsoft CDO for Microsoft Exchange
    VERSION:2.0
    BEGIN:VTIMEZONE
    TZID:(GMT+01.00) Sarajevo/Warsaw/Zagreb
    X-MICROSOFT-CDO-TZID:21
    BEGIN:STANDARD
    DTSTART:20070112T140000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0100
    END:STANDARD
    BEGIN:DAYLIGHT
    DTSTART:20070112T140000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    END:DAYLIGHT
    END:VTIMEZONE
    BEGIN:VEVENT
    DTSTAMP:20061213T141132Z
    DTSTART;TZID="(GMT+01.00) Sarajevo/Warsaw/Zagreb":20070112T140000
    SUMMARY:This is calendar test
    UID:040000008200E00074C5B7101A82E0080000000030D51864C81EC701000000000000000
    010000000CA9F127EA8947844BC4DD47F269BDEA9
    ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Xu, Rocky":MAILTO:rocky@***.com
    ORGANIZER;CN="Xu":MAILTO:rocky@**.com;roc*@gmail.com
    LOCATION:Shanghai
    DTEND;TZID="(GMT+01.00) Sarajevo/Warsaw/Zagreb":20070112T160000
    DESCRIPTION:This is calendar content\N
    SEQUENCE:0
    PRIORITY:5
    CLASS:
    CREATED:20061213T141132Z
    LAST-MODIFIED:20061213T141133Z
    STATUS:CONFIRMED
    TRANSP:OPAQUE
    X-MICROSOFT-CDO-BUSYSTATUS:BUSY
    X-MICROSOFT-CDO-INSTTYPE:0
    X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
    X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
    X-MICROSOFT-CDO-IMPORTANCE:1
    X-MICROSOFT-CDO-OWNERAPPTID:367904726
    X-MICROSOFT-CDO-APPT-SEQUENCE:0
    X-MICROSOFT-CDO-ATTENDEE-CRITICAL-CHANGE:20061213T141132Z
    X-MICROSOFT-CDO-OWNER-CRITICAL-CHANGE:20061213T141132Z
    END:VEVENT
    END:VCALENDAR
    _=_NextPart_001_01C71EC0.97A011C6--
    My question is
      1. How to generate this kind of payload in mail adapter module?
      2. It is possible to send appointment via mail adapter?
    Following i can get from other system, even using mail package check or not using mail package check.
    BEGIN:VCALENDAR
    METHOD:REQUEST
    PRODID:Microsoft CDO for Microsoft Exchange
    VERSION:2.0
    BEGIN:VTIMEZONE
    TZID:(GMT+08.00) Kuala Lumpur/Singapore
    X-MICROSOFT-CDO-TZID:21
    BEGIN:STANDARD
    DTSTART:16010101T000000
    TZOFFSETFROM:+0800
    TZOFFSETTO:+0800
    END:STANDARD
    BEGIN:DAYLIGHT
    DTSTART:16010101T000000
    TZOFFSETFROM:+0800
    TZOFFSETTO:+0800
    END:DAYLIGHT
    END:VTIMEZONE
    BEGIN:VEVENT
    DTSTAMP:20070608T025852Z
    DTSTART;TZID="(GMT+08.00) Kuala Lumpur/Singapore":20070608T110000
    SUMMARY:This is meeting request with attachment
    UID:040000008200E00074C5B7101A82E0080000000000A9BD0BA7A9C701000000000000000
    010000000C5E16D144D1612498C0EF7E2115EFEC4
    ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Xu, Rocky
    ":MAILTO:roc*@**
    ORGANIZER;CN="Xu,y":MAILTO:roc*@**
    LOCATION:India labs
    DTEND;TZID="(GMT+08.00) Kuala Lumpur/Singapore":20070608T113000
    DESCRIPTION:This is content!  &#60;&#60;shanghai.txt&#62;&#62; \N
    SEQUENCE:0
    PRIORITY:5
    CLASS:
    CREATED:20070608T025925Z
    LAST-MODIFIED:20070618T033505Z
    STATUS:CONFIRMED
    TRANSP:OPAQUE
    X-MICROSOFT-CDO-BUSYSTATUS:BUSY
    X-MICROSOFT-CDO-INSTTYPE:0
    X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
    X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
    X-MICROSOFT-CDO-IMPORTANCE:1
    ATTACH:CID:008501c7b159$a9d41d3b$_CDOEX
    X-MICROSOFT-CDO-OWNERAPPTID:1468557271
    X-MICROSOFT-CDO-APPT-SEQUENCE:0
    X-MICROSOFT-CDO-ATTENDEE-CRITICAL-CHANGE:20070608T025852Z
    X-MICROSOFT-CDO-OWNER-CRITICAL-CHANGE:20070608T025852Z
    END:VEVENT
    END:VCALENDAR
    Thanks & regards
    Rocky

    Hi
    have a look at this
    You can use Java/ABAP proxies to do this job for you..
    Java Proxy >> will read the mail(with the attachments) with the help of Java APIs and send the message into XI ABAP Proxy >> for this you will have to first convert the attachment into a message and then you can proceed in the regular fashion.
    Not all adapters can process attachments, I'm not sure why you are having trouble with using module processor in the mail adapter. Just check if the service pack that you are using supports this feature.
    If you are on WAS 6.10 and above you can achieve this and there is an excellent weblog by Thomas Jung on this topic at
    /people/thomas.jung3/blog/2004/09/09/receiving-e-mail-and-processing-it-with-abap--version-610-and-higher
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5816
    reading Pdf Through mail easly done with Java Proxy, which will read the mail(with the attachments) with Java APIs and send the message into XI and then map with the Target ABAP proxy structure .
    Thanks

  • Setting the charset from an adapter module

    Hi folks,
    I'm trying to set the charset encoding of a payload using an adapter module (I know there is a TextCodepageConverterBean, but I want to set the charset for a message that hasn't one yet). The problem is probably more clear using an example.
    I output a UTF-8 flat string from my message mapping to the adapter framework (mail adapter in my case). Afterwards I want to convert this UTF-8 string to an ISO-8859 encoding with the TextCodepageConverterBean. But if I set the charset using the setContentType() function of my TextPayload object the information gets cut away. I'm using the format
    setContentType("text/plain;charset=utf-8;name=Test.txt")
    . But everything after the first semicolon is dropped. Setting the charset using the MessageTransformBean works, but I want to avoid this by all means, as I need to set the mime type from the adapter module.
    This is running on NW2004 with SP 16 and the latest patch.
    Any idea, why the MessageTransformBean works and not the setContentType call?

    This bug will be fixed with SP20.
    Regards
    Stefan

  • Adapter Module for File Adapter using Eclipse

    I want to develop Adapter Module using Eclipse, please let me know if it is possible?
    -How to use Eclipse to develop adapter module and deploy it on J2ee server.
    Thanks

    Hi,
    If you have NWDS , then you can directly deploy AM in PI server, if you are using eclipse to write code then genarate EAR file of your code, then you have to deploy in SDM using manual process.
    SEARCH IN SDN like how to deplot AM's, you will find many documents.
    Regards,
    RAJ

  • Sender SOAP Adapter Modules!

    Hi Can anyone guide me how to write a Sender SOAP adapter module ?

    Hi Pooja, thanks for the reply I have seen that.
    Please look at the below forum.
    SOAP Adapter and plain HTTP
    It  says "When you write a module for sender SOAP adapter, you have to deal with the incoming message, as the SOAP adapter first calls the customer module, then creates the XI message."

  • Creating Adapter Modules

    Hello
      Can anyone tell me as to how do i create my own adapter modules. The java caode has been developed but where in the configuration builder of XI should this be stored and how?Could someone explain the entire process as to how to do this and also the configuration that needs to be done.
    Regards
    Sharat

    1. Make sure you have the following jar files with you.
    aii_af_cci.jar
    aii_af_mp.jar
    aii_af_ms_api.jar
    aii_af_ms_spi.jar
    aii_af_trace.jar
    aii_af_svc.jar
    aii_af_cpa.jar
    2. Open NetWeaver Developer Studio. Create a new EJB Module
    New>J2EE>EJB Module.
    Specify a meaningful name for the module and click Finish.
    3.  Right click on the folder ejbModule and create new package.
    Enter a meaningful name for package and click Finish.
    4.  Right click on the Project, select New-->Folder. Enter lib as the folder name.
    Copy all the jar files specified above from your local system and paste them into newly create lib folder.Right click on the project. Select Properties-->Java build path. Go to Libraries tab and add the jar files from lib folder to the classpath.
    5.Switch to J2EE Perspective-->J2EE Explorer tab.
    Right click on the newly created package and select New-->EJB.
    6. Specify a meaningful name for the EJB. Select Bean Type as Stateless Session Bean.
    Make sure to uncheck the checkbox “Generate default interfaces”.
    Click on Next.
    7.On the next screen change the values of following attributes as specified below.
    Remote Interface: com.sap.aii.af.mp.module.ModuleRemote
    Home Interface: com.sap.aii.af.mp.module.ModuleHome
    Local Interface: com.sap.aii.af.mp.module.ModuleLocal
    LocalHome Interface: com.sap.aii.af.mp.module.ModuleLocalHome
    Click on Finish.
    8. After clicking on Finish, a Creation error will be reported. Ignore this error as the file would still be created as specified.
    Open the newly created file in Java Editor and add “Module” to the implements list of the bean class. Press Ctrl + Shift + O to remove import errors if any.
    You will see a new error as
    “Class must implement the inherited abstract method Module.process(ModuleContext, ModuleData)”.
    Right click in the java editor and select Source-->Override / Implement methods. Select process method from Module interface and click Ok.
    You should have an error free build of the project after this.
    process is the only method where we need to write the business logic.
    With this you are ready to right the situation specific business logic in the process method.
    9. Once you create a deployable archive i.e. .ear for this using NDS, you can deploy this archive using NDS or using SDM.

  • How to access Adapter Specific Message Attribute in my  own adapter module

    Hi,
    I'm developing a mail adapter customer module. Now I have a requirement about getting the CC information from mail. Even if I
    checked the option of "use mail package" when configing sender Mail Adapter, I still can not get CC information in my module
    because it is not included in mail package.
    I got to know CC information is included in ASMA(Adapter Specific Message Attribute), but how can I access ASMA in my module?
    Till now I know there are two ways to access ASMA
    1. use AF_Modules/DynamicConfigurationBean XI standard module to access ASMA.I did it as below:
    add this module in front of my own module, then set key: write http://sap.com/xi/XI/System/Mail SHeaderCC and value :      
    <b>message.refToMessageId</b>(which message property should be put here?). I'm trying to get it by message.getRefToMessageId() in my
    own module. But what happens is not as I expected, I get null instead of CC information. Which step I did wrong?
    2. use mapping api
       DynamicConfiguration conf = (DynamicConfiguration) <b>container</b>
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
         DynamicConfigurationKey key = DynamicConfigurationKey.create(
             “http://sap.com/xi/XI/System/Mail”,
             “SHeaderCC”);
    but how can I get <b>container</b> object in my module?
    Is there any other way to access ASMA in customer module?
    Thanks

    hi,
    >>>>but how can I access ASMA in my module?
    have a look at this blog:
    /people/daniel.graversen/blog/2006/10/05/dynamic-configuration-in-adapter-modules
    and try getMessageProperty
    it's also here:
    in Adapter-Specific Message Attributes link
    http://help.sap.com/saphelp_nw04/helpdata/en/17/50d440e14f8431e10000000a1550b0/frameset.htm
    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>

  • Adapter Module for Sender File Adapter to access a Flat file

    Hi,
    We have a scenario where the source is a flat file.I want to develop an Adapter Module to make a small change to every line in the Flat file.
    Now how do we read a flat file in the Adapter Module?Coz the flat file will be converted to XML file by the Standard Adapter Module of the File adapter.
    Please help me out with this.
    Thank you,
    Anu.

    Hi Anu,
    If you are not using Content Conversion option Standard Adapter Module does not convert the Flat file to XML .
    You can directly access the payload as it is in flat file in the Adapter Module and make changes.
    Use the Standard classes ModuleData & moduleContext to fetch the Payload.
    chk this :
    Customized Sender Adapter Module
    XI: Read data from PDF file in Sender Adapter
    regards
    Ganga

Maybe you are looking for

  • Table name and field name

    hi frds Give me table name and field name of OPEN PO QUANTITY .. thanks Pari Vendhan.R

  • Posting only customer master IDOC which has data change

    Hello experts, I need some help urgently. We have a scenario where a third party system sending customer master data using IDOC's. The issue is the sending system is posting the entire customer master thru IDOC's . Now we want to pick only those IDOC

  • How do i return to the form i was filling in

    I lost the document i was filling on line, How do i get it back and was my work saved/   Thanks    locopony.

  • Kodo jdoql oracle problem

    Hi there, In my project, I have a jdoql query (select column1 from table1 where column2 == ''). It works fine with DB2 since DB2 supports empty string. When I moved it to oracle, the query doesn't get translated into something like (select column1 fr

  • Using iMac sound output with JBP 'Creature' speakers

    Am trying to install a pair (set actually) of JBL Creature speakers. I am using the iMac digital audio output which I understand should also serve as an analogue output. However, the sound out of the JBLs is quite muffled, tinny, and low, which leads