Adaptor Module Developemnt ?

Hi @ ,
I need to develop Adaptor module.I dont know thow to do that .
I need some docs or reference to do the same .
Regards

Hi
check this primer
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3bdc14e1-0901-0010-b5a9-a01e29d75a6a
(How to develop a module for reading file name in a sender file adapter XI 3.0)
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/da5675d1-0301-0010-9584-f6cb18c04805
and this weblog
/people/francesco.bersani/blog/2007/03/27/rename-attachment-adapter-module
regards
krishna
Note:award points id useful

Similar Messages

  • How to set the target directory from source filename using adaptor module.

    Hi,
    How im using a logical bypass scenario.I have to set the target directory using the sorce filename.There is no chance of using a Java UDF as my scenario does not have a Mapping(as it is a Bypass Scenario).The only option that i got is to use a Adaptor module.Can anyone help  me this.
    Thanks,
    Bhargav

    Hi,
    See this link,
    http://help.sap.com/saphelp_nw04/helpdata/en/e9/61e1407e858031e10000000a1550b0/content.htm
    hope it helps.
    Regards,
    Akshay Jamgaonkar.
    Reward points if find useful.

  • Custom Adaptor Module on Soap Receiver

    Hi All,
    In PI 7.1.1 I have a soap receiver communication channel with a call to a simple custom adaptor module before and after the call to the XISoapAdaptorBean
    The call before works displaying the message in the call. It seems that the module is not being called for the response.
    This used to work in XI. What's changed?
    John

    Hi Stefan,
    To the best of my knowledge I've followed the API when switching the code. The module is extremely simple at the moment; it just logs that it's been called.
         public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData)
              throws ModuleException
         { // process
    //          get the XI message
              try
                   Message msg = (Message)inputModuleData.getPrincipalData();
                   MessageDirection iDirection=msg.getMessageDirection();
                   amk = new MessageKey(msg.getMessageId(), iDirection);
                   Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "CreateKeyFields: Module called");
              catch (Exception e)
                   ModuleException me = new ModuleException(e);
                   throw me;
              return inputModuleData;
         } // process
    I'm missing com.sap.aii.af.cpa.svc_api.jar, is this likely to be the culprit? It still compiles, deploys and works for all the outbound modules I've worked on.
    Kind regards,
    John

  • Accessing SOAP header information in a custom adaptor module

    Hi Guys,
    Could anyone point me in the direction of information on how to access the SOAP:Header element when writing a custom adaptor module for a http/ SOAP communication channel?
    I'm trying to add some WS-Security stuff which isn't available in XI 3.0.
    Many thanks,
    John

    The solution is as follows:
    Mark as Do Not Use SOAPEnvelope in the communication channel.
    It may be possible to use the SAP implementation of MessageFactory, SOAPEnvelope etc., I forced XI the Apache Axis implementation, a thread on which can be found here Link: [Accessing SOAP header information in a custom adaptor module;
    The SOAP Envelope is created by
    javax.xml.soap.MessageFactory mf= org.apache.axis.soap.MessageFactoryImpl.newInstance();
    This doesn't work it creates a com.sap.engine.services.webservices.jaxm.soap.SOAPMessageImpl
    org.apache.axis.message.SOAPEnvelope env = new org.apache.axis.message.SOAPEnvelope();
    org.apache.axis.Message iSoapMessage = new org.apache.axis.Message(env);
    SOAPMessage sm = iSoapMessage;
    SOAPBody iBody = se.getBody();
    if(iBody!=null)
         iBody.addDocument(iDoc);
         addDocument failed for some reason when called in XI returning
         Exception caught by adapter framework: Exception in method process.
         The code below is copied straight from the addDocument method, but it works.
         org.w3c.dom.Element iDocRoot= iDoc.getDocumentElement();
         org.apache.axis.message.SOAPBodyElement bodyElement = new org.apache.axis.message.SOAPBodyElement(iDocRoot);
         iBody.addChildElement(bodyElement);
    In order to get a document representation of the Envelope you can use
    Document iEnvelopeDoc = ((org.apache.axis.message.SOAPEnvelope)env).getAsDocument();
    You are now in a position to add or adjust the SOAP Envelope as your require. It enabled me to add WS-Security information to a message.
    It is normally possible to use javax.xml.transform.Transformer on the various classes SOAPEnvelope, SOAPBody etc. as they implement Node. However doing this in XI caused a crash.
    The final document can be then be set in the xmlPayload before being sent out the door.
    Hope this helps someone,
    John

  • Adaptor Module creating wrong version of class

    Hi Guys,
    I wonder if anyone can possibly shed any light on the following problem.
    I am trying to create an instance of apache Axis' MessageFactory
    However every time the Adaptor Module (Called ClientAuthentication) is called the following class is created - copied from the Message Display Tool
    ClientAuthentication: com.sap.engine.services.webservices.jaxm.soap.MessageFactoryImpl created
    I have the following in my imports
    import org.apache.axis.soap.MessageFactoryImpl;
    import javax.xml.soap.SOAPBody;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPHeader;
    import javax.xml.soap.SOAPMessage;
    import javax.xml.soap.SOAPPart;
    And, at this stage, I have explicitly referenced the axis class when creating the instance:
    // MessageFactory mf = MessageFactory.newInstance();
    // Creating com.sap.engine.services.webservices.jaxm.soap.SOAPMessageImpl
    javax.xml.soap.MessageFactory mf= org.apache.axis.soap.MessageFactoryImpl.newInstance();
    Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "ClientAuthentication: " + mf.getClass().getName() + " created");
    Looking at the class in the exported EJB via a decompiler shows
    MessageFactory mf = MessageFactoryImpl.newInstance();
    Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "ClientAuthentication: " + mf.getClass().getName() + " created");
    And the result is a com.sap.engine.services.webservices.jaxm.soap.MessageFactoryImpl is created resulting in the wrong SOAPMessage which crashes when returning it's SOAPPart
    Any help would be appreciated,
    John

    Hi,
    It is possible to bypass the call to an implementation of MessageFactory and ensure the axis library is used to create the SOAPEnvelope using
    org.apache.axis.message.SOAPEnvelope env = new org.apache.axis.message.SOAPEnvelope();
    env.setSAAJEncodingCompliance(true);
    org.apache.axis.Message iSoapMessage = new org.apache.axis.Message(env);
    iSoapMessage.setMessageType("request");
    SOAPMessage sm = iSoapMessage;
    Instead of
    javax.xml.soap.MessageFactory mf= org.apache.axis.soap.MessageFactoryImpl.newInstance();
    SOAPMessage sm = mf.createMessage();
    Which wasn't returning the right implementation of MessageFactory and hence SOAPEnvelope.
    The addDocument to the SOAPBody is still crashing the same way, but this questionis answered.
    All the best,
    John

  • Module developemnt: casting to Message

    I dot ClassCastException for SOAP sender adapter module in line
    Message message = (Message) moduleData.getPrincipalData();
    Could you help what's wrong with Module?

    Hello Stefan,
    do you have more information about developing modules for the soap sender adapter?
    I made some tests and also noticed that there is a difference...when writing modules for normal sender adapters (e.g. File Adapter), the principal data seems to be of type 'com.sap.aii.adapter.xi.ms.XIMessage', whereas the principal data in the soap sender adapter is of type 'com.sap.aii.messaging.mo.MessageContext'.
    Is any information available about class 'com.sap.aii.messaging.mo.MessageContext'? Alas, I couldn't find any...
    Thanks & regards,
    Matthias

  • Content Conversion Module with the J2EE JMS Adapter

    HI,
    I am following this PDF
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/50061bd9-e56e-2910-3495-c5faa652b710
    I have done according to No 3 (page 5) and No 3.1 (page 6),
    but in Adapter Monitor I am getting the following error
    Error: Module exception java.lang.ClassCastException found
    what is this error and where I have to check
    Help pls
    Thanks
    dushanth
    Message was edited by:
            dushanth ry
    Message was edited by:
            dushanth ry

    hi
    Try with this
    Check the library files(aii_af_mp.jar, aii_af_ms_api.jar and aii_af_trace.jar ) are inside the EAR. If this is the case, delete them before deploying
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/02706f11-0d01-0010-e5ae-ac25e74c4c81
    ClassCastException using Moduleprocessor
    Module developemnt: casting to Message
    Thanks

  • EJB module Error Observed ::?

    Hi @,
    In my custom adaptor module I am getting the following error ::
    Attempt to process file failed with com.sap.engine.services.ejb.exceptions.BaseTransactionRolledbackLocalException: Exception thrown in method process. The transaction is marked for rollback.
    PLease suggest why this error is coming ?
    Regards

    Hi Beyong,
    Check your method "Process"...It indicates exception is raised in methid "Process"...
    Also you can changeyour exception part by..
    catch (Exception e) {
         ModuleException me = new ModuleException(e);
         throw me; :
    Otherwise you can debug the exact location by :
    For this you would need to carry out certain steps which are :
    1. In NWDS , create a new file in the META-INF folder of Enterprise Project. The name of the file should be log-configuration.xml.Paste the following content in this file
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE log-configuration SYSTEM "log-configuration.dtd">
    <log-configuration>
    <log-formatters>
    <!-- This formatter produces human readable messages. -->
    <log-formatter
    name="trc"
    pattern="%26d %150l [%t] %10s: %m"
    type="TraceFormatter"/>
    </log-formatters>
    <log-destinations>
    <!-- Destination for Trace Information of this sample -->
    <log-destination
    count="5"
    effective-severity="DEBUG"
    limit="2000000"
    name="sample.trc"
    pattern="./log/applications/sample/default.trc"
    type="FileLog">
    <formatter-ref
    name="trc"/>
    </log-destination>
    </log-destinations>
    <log-controllers>
    <!-- Trace Location sample -->
    <log-controller
    effective-severity="DEBUG"
    name="sample">
    <associated-destinations>
    <destination-ref
    association-type="LOG"
    name="sample.trc"/>
    </associated-destinations>
    </log-controller>
    <!-- Logging Category: none, use the default XILog -->
    </log-controllers>
    </log-configuration>
    2. In your process method, add following statement
    AuditMessageKey auditMKey =
                   new AuditMessageKey(message.getMessageId(), AuditDirection.INBOUND);
              Audit.addAuditLogEntry(
                   auditMKey,
                   AuditLogStatus.SUCCESS,
                   "CustomModule :: process method started");
    This would send the statement "CustomModule :: process method started" to the Audit Log of XI server and you would be in a position to see upto which step your code is executing sucessfully. Audit log can be viewed at
    http://<host>:<port>/MessagingSystem/monitor/monitor.jsp. you need to know the message ID for your transaction in this case.
    Hope this wull help you.
    Nilesh

  • DynamicConfigurationException:Unable to set ASMA in Module

    Hi,
    I have written customized adaptor module and trying to set the FileName to Dynamic Configuration object. But it is throwing error.
    I used the below code:
    Message msg = null;
    MessagePropertyKey key= new MessagePropertyKey("http://sap.com/xi/XI/System/File","FileName");
    msg.setMessageProperty(key,"Testing");
    moduledata.setPrincipleParameter(msg);
    I have enabled "FileName" the ASMA(adapter specific message attribute) in receiver communication channel. But it is throwing the below exception.
    "DynamicConfigurationException:: The adapter message property "FileName" was specified as mandatory element, but was not supplied in XIMessageHeader".
    Working on PI7.1.
    Please let me know, if i need to do any changes.

    "DynamicConfigurationException:: The adapter message property "FileName" was specified as mandatory element, but was not supplied in XIMessageHeader".
    I used the below code:
    Message msg = null;
    MessagePropertyKey key= new MessagePropertyKey("http://sap.com/xi/XI/System/File","FileName");
    msg.setMessageProperty(key,"Testing");
    moduledata.setPrincipleParameter(msg);
    just you have to use below code insted of what ever u wrote the code.
    String DynamicConfig(String a, Container container) throws StreamTransformationException{
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    conf.put(key,a);
    return "";
    and in Receiver file communication channel , just you have to enable ASMA and file name.
    Note:
    if Ur scenario is File To File then just enable Asma and file name in both sender and receiver adapters.

  • Custom Adaptor for JDBC Communication Channel

    Hi Guys,
    My apologies if this has been asked before, but I did a few searches and could not find anything.
    I'm trying to write an adaptor that will use/ access the information passed into a JDBC Receiver communication channel prior to the normal adaptor being called.
    Iu2019ve written a module that gets as much information from the ModuleContext and the ModuleData as possible, but I canu2019t find where the information on the database connection is being passed.
    Is there any way of accessing the Database Connection information in a custom adaptor module?
    Kind regards,
    John

    Hi 'PI Expert'
    Thanks for your reply. I'm not sure we can use that as we're running PI7.0, but just in case:
    I can't find too much information suggesting that it's possible to call the Directory API from within an adaptor module allowing the information to be read, and hopefully modified, when the communication channel is used.
    Is it possible to call the Directory API from within a custom adaptor module?
    Kind regards,
    John

  • MIME format in Mail adapter

    Hi All
    I am currently using the email receiver adapter with mail package and able to send the MIME messgae format from the content field of the mail package.
    i am sending 3 attchments from MIME format in content, when i use the Mail package i cannot send the BCC and CC fields in that, so i have chnages my configuration to send the MIME message with attachments without using the mail package but i am not able to receive the mail with attachment.
    when i send the MIME fomat without using the mailpackage entire format cmes as mail content...with MIME header and other details.
    How do i specify the mail receiver adapter to recoginze the message as MIME and send content and attchment in that.
    i have included the MIME header also.
    kindly let me know about this.
    regards
    Nisar Khan

    Hi Stefan,
    I tried passing the MIME strucutre in the same way as in your blog, but i am not getting the output in a proper way, i am getting the attachment but no content in email.
    i tired with the various combinations ofr MIME formats, the content doesnt come only attachments appear.
    have passed the obligatory lines also and (content type is multipart with boundary detail)
    Lot of the email notifations to the customers have CC and BCC fields and multiple attachmetns genreteated in mapping like HTML, XSL etc....this is imp part of our design and we dont want to use any module developemnt for this.
    let me know have you tried this, does this work?
    regards
    Nisar Khan

  • Error in Communication channel java.lang.NullPointerException

    Hello Experts,
    We have a file adaptor which we using to send data to the file sytem. We are getting the following  error
    Message could not be forwarded to the JCA adapter. Reason: java.lang.NullPointerException: while trying to invoke the method com..pi.af.adapter.sftp.ReceiverAdapter.process(com.sap.engine.interfaces.messaging.api.Message, java.lang.String) of an object returned from com..pi.af.adapter.sftp.XIConfiguration.getReceiverAdapter(java.lang.String)
    Any idea why we get this error.
    BR

    Yes Adaptor module is fine  we have not done any changes in the adaptor module . the channel was working fine and was able to delivery data successfully and suddenly it stop working.. We haven't made any change to the  communication channel

  • File to idocs - sequence of inbound processing

    Hi everybody,
    we have a file to (2) idocs scenario. In XI we map the received data of vendors into two idocs (adrmas and cremas). After building the idocs we send them in that sequence to the reveiver systems (recommended). The problem is that in the receiver system very often the idoc cremas wants to be processed before adrmas is ready. This leads to the error "vendor xy is blocked by user sapale". Especially for massprocessing I get a lot of these error-messages in bd87. As workaround I processed all the error-idocs by the report rbdmani2. (First step adrmas - second step cremas) But then I face missing data in some cases in table lfa1 - which seems to me that the sequence of 1. adrmas and 2. cremas was not correct processed.
    Is there a possibility for inbound processing with the rule process adrmas - wait until ready - process the associated cremas and so on?
    I checked the sap-help article for seralisation - but we could not achieve a better result by queing the outgoing messages in the xi.
    Thanks very much.
    With kind regards
    Jörg

    You have to get a solution based on the following concepts
    1. Do not use BPM it is not efficient
    2. Understand what is the difference between an IDOC in received state and processed state. Received state mean IDOC is saved into IDOC table. Processed state mean IDOC processed into the business system.
    3. You can ASK BASIS guy to turn on the immediate IDOC processing option in SAP system,so that SAP process the IDOC as soon as it arrive in IDOC table. This is not efficient, in case if your SAP system has to process SAP online client request and SAP document (inbound and outbound) same time.
    4. Understand the concept of standard based integration, mean integration system provide the option to business parties to provide the successfull message transfer.
    Based on all these points I recomend you to follow the steps below.
    1. Extract each record from the input files into two idocs.
    2. Send the first IDOC to the receiving system
    3. Send the second IDOC to a ESB storage such as DATABASE, JMS Queue, MQ Series Q (if you have available) or even to another File.
    4. Develop an RFC module to check the status of the IDOC being send to the receiving system. Status here mean whether the IDOC data processed into the business system. You can do this lookup using a custom RFC lookup using the attribute connecting the first IDOC record with second IDOC.
    5. Process the records (second IDOC) from the intermediate storage using the RFC lookup into the business system updates its status as ready to deliver.
    6. Using another process such as FILE to IDOC or JMS to IDOC or JDBC to IDOC send each record which are ready to process from intermediate storage to the receiving system.
    7. Create a report using FILE or JMS, JDBC adaptor module to keep track of these three stage processing, so that in case an inconsistency happed you will have an auditing trace available.
    This is the standard based integration approach.
    ABAP guys, BASIS guys they may not get it when then repair a BMW in local auto workshop, cuz I had to fight with them 4 years ago to make it happen in Verizon supply chain project where I had to accomplish the same concept in SAME IDOCS you mentioned here.
    BPM, turning on immediate processing of IDOCS etc will end up in buying another 16 CPU hardware and BASIS guys or ABAP guys running BAD record IDOC processing report for 350.00 hr consulting FEES.
    SAP is a good company and XI is a good product, as long as it is being used as per right usage.

  • Get attached file outof incoming mail

    Hi,
    I've created an interface (Mail2Rfc), in which file is attached to incoming mail message. my basic reference was /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step which demonstrate how to implement getting attached file content via adaptor module.
    my issue:
    the file name can be changed, therefore the file_name parameter (required by adaptor module) can not be hard coded.
    how can i bypass the issue?
    Please advise,
    Uri

    Hi,
    10x for your replay.
    plz clarify:
    what is the module configuration i have to use? which Parameters & Parameters Values?
    currently i'm useing:
    swap.keyName=Content-Disposition
    swap.keyName=Content-Description
    swap.keyValue=attachment;filename="MailAttachment-1.xml";
    swap.keyValue=MailAttachment-1
    I tried to use keyName = payload-name instead of other keyName values, and interface was failing.
    Regards,
    Uri

  • Download & save pdf file (mail to file scenario)

    Hi All,
    I have a simple scenario (mail to file), in which pdf file is being attached to incoming mail message. Attachment is "downloaded" (using localejbs/AF_Modules/PayloadSwapBean adaptor module(.
    Since no mapping required, the used "Integrated Configuration".
    my scenario works fine, no ERR and pdf file is created at target directory.
    When I'm trying to open the file the adobe is showing to following err msg:
    "Adobe Reader could not open 'xi_output.pdf' because it is either not a supported file type or because the has been damaged.."
    What can be done, to bypass the problem? Please advice.
    Regards,
    Uri

    Hi,
    >>>The only difference is that my current scenario is based on "Integrated Configuration", does it make sense?
    hmm this should work in the very same way with ICO but I never tested it with it frankly speaking
    but the adapter module works on the same adapter as without ICO so why should there be a difference
    (the swaping is done before the message is delivered to the IE or AAE processing)
    but you can try writing a note to SAP to crosscheck if this module works with local AAE
    Regards,
    Michal Krawczyk

Maybe you are looking for

  • Adobe Media Encoder CS4 Encoding Error

    I got an error when Adobe Media Encoder CS4 encoding which is the crash of ImporterProcessServer. It crashes the halfway of the encoding process. I restarted my comp and tried several times before but the results still the same. Sometimes ImporterPro

  • Recreation of user mailbox from exchange 2007 to Exchange 2013

    In my domain I was using Exchange 2007 earlier. I have installed Exchange 2013 successfully and running perfectly. I have one Issue: 1. A user's mailbox in Exchange 2007 was disabled from Exchange 2007 and recreated on Exchange 2013. When a user try

  • Re: Follow up on an old thread about memoryutilization

    At 04:21 PM 12/5/96 -0800, you wrote: This thread was active a few months ago, unfortunately its taken me until now for me to have enough spare time to craft a response. Derek, Thank you for finally giving me a more in-depth explanation of some of th

  • Itunes doesnt recognize my iphone 3gs after i upgraded to ios4.1

    itunes doesnt recognize my iphone 3gs after i upgraded to ios4.1

  • Itunes won't open after restore...

    I had to restore my computer and now when I try and open itunes I get this message: +The file "itunes library.itl" cannot be read because it was created by a newer version of itunes.+ Anyone care to chime in and help me out. I hope I have not lost my