Set a variable in Adapter Module and read it during message mapping

Hi guys,
is there any way, how I could set some variable and store its value during the adapter module processing and read back this value in message mapping and use it? Without using a database or files.. I mean, some j2ee storage or something like that..
Thanks for your help,
Olian

Hi guys,
thanks for your answers..  just a clarification, what the problem is.
I need to validate a message in the adapter module, if it's digital signature is valid. If it is, I need to send back to the sender a return code (message) OK, otherwise ERROR. I can't modify the message (or dynamic configuration) as I'm using a WSS in the sender channel. The system doesn't allow me to change anything in the message, so I can't find out in the mapping what the validation result was. I then tried to do the validation directly in the message mapping, but I have some issues there with libraries or what, because the validation code, which works in the adapter module, doesn't work in the mapping java class. So my final thought was maybe I could validate the message in the adapter module and pass the result to the message mapping and then create an appropriate return message (in the mapping). However, I see no way of passing a value there. I'm stuck and have no Idea how to resolve the problem. Any hints guys?
Thanks a lot for your help!
Olian

Similar Messages

  • Adapter module to read excel file -java code required for PI 7.1

    Hi PI experts,
    I am working on PI 7.1 SP 08.
    I am trying to develope an adapter module to read excel file
    http://wiki.sdn.sap.com/wiki/display/ABAP/AdapterModuleToReadExcelFilewithMultipleRowsandMultiple+Columns
    but here in this wiki , given java code is for pi 7.0 and it is using jar file from PI 7.0
    I tried with using corresponding PI 7.1 files
    com.sap.aii.af.lib.mod.jar:
    sap.comtcloggingjavaimpl.jar:
    com.sap.aii.af.svc_api.jar:
    com.sap.aii.af.cpa.svc_api.jar:
    com.sap.aii.af.ms.ifc_api.jar:
    jave program is not throwing any error in NWDS but After deploying file on server.
    i am getting this errot in communication channel
    2009-12-15 15:47:08 Information AO: Now calling the Convert Method to convert Excel to XML.
    2009-12-15 15:47:08 Error MP: exception caught with cause javax.ejb.TransactionRolledbackLocalException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file; nested exception is: javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file; nested exception is: javax.ejb.EJBTransactionRolledbackException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file; nested exception is: javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file
    since i am not a JAVA expert so i am unable to resolve this error
    if some one has already deployed this module for PI 7.1, then please provide me java code for PI 7.1
    Thanks
    sandeep sharma

    hi,
    please try this:
    obj = inputModuleData.getPrincipalData();
    msg = (Message) obj;
    amk = new MessageKey(msg.getMessageId(),msg.getMessageDirection());
    XMLPayload xpld = msg.getDocument();
    Workbook wb = Workbook.getWorkbook((InputStream) xpld.getInputStream());
    xmldata ="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n"+ "<ns0:"msgType" ""xmlns:ns0=\""nameSpace+"\">";
    Cell[] cells ;
    Cell[] cellNames ;
    cellNames = wb.getSheet(0).getRow(0);
    for(int j=1;j<wb.getSheet(0).getRows();j++)
    xmldata = xmldata+"<Record>";
    cells = wb.getSheet(0).getRow(j);
    for(int i=0;i<wb.getSheet(0).getColumns();i++)
    xmldata = xmldata"<"cellNames<i>.getContents()">"cells<i>.getContents()"</"cellNames<i>.getContents()+">";
    xmldata = xmldata+"</Record>";
    xmldata = xmldata"</ns0:"msgType+">"; 
    wb.close();
    byte byt[] = xmldata.getBytes();
    xpld.setContent(byt);
    inputModuleData.setPrincipalData(msg);
    Thanks,
    Mayank

  • I want to set a variable with default value and can be changed by the user

    hi,
    i want to set a variable with default value and can be changed by the user, so i new a variable with setting : customer exit, single value, optional, ready for input.
    in my customer exit code, i set a default value, eg. 20070530
    when the variable screen popup, it display the default value 20070530, i changed it to 20070529, but it doesn't work , it still display the data in 20070530, how can i solve this problem? 
    your help is appreciated.

    Liu,
       As mentioned by Anil, you need to restrict your customerr Exit code to I_STEP = 1.
    or.
       <u>Open your Variable in change mode, in the Last Page os the Variable Maintenance you can provide default value. Note: you are doing same thing in Customer Exit. In your case no need of Customer Exit.</u>
    Nagesh Ganisetti.
    Assign points if it helps.

  • [svn:bz-trunk] 23143: Certain code needs to check the existence of the class validation validator  (some brokers and other listeners) during message broker init, however the validator was not being created till the very end of the method .

    Revision: 23143
    Revision: 23143
    Author:   [email protected]
    Date:     2011-10-27 06:31:02 -0700 (Thu, 27 Oct 2011)
    Log Message:
    Certain code needs to check the existence of the class validation validator (some brokers and other listeners) during message broker init, however the validator was not being created till the very end of the method.  Promote it to be at the top instead of at the bottom.
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/config/MessagingConfiguration.java

    Revision: 23143
    Revision: 23143
    Author:   [email protected]
    Date:     2011-10-27 06:31:02 -0700 (Thu, 27 Oct 2011)
    Log Message:
    Certain code needs to check the existence of the class validation validator (some brokers and other listeners) during message broker init, however the validator was not being created till the very end of the method.  Promote it to be at the top instead of at the bottom.
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/config/MessagingConfiguration.java

  • Generic adapter module to read any xl file

    Hi Experts,
    I have a requirement where i was suposed to read xl file using sender file adapter module.
    Now i see ther are three more xls files of a completely different format, is ther any generic mdue to read so..can i be developed..
    or do i have to develope three different modules for this requirement..
    pls help me out

    Hi Ravindra
         public ModuleData process(
                   ModuleContext mc,
                   ModuleData imd)
                   throws ModuleException {
                   Object obj = null;
                   Message msg = null;
                   String msgType = null;
                   String nameSpace = null;
                   try {
                          obj = imd.getPrincipalData();
                          msg = (Message) obj;
                          msgType = (String) mc.getContextData("msgType");
                          nameSpace = (String) mc.getContextData("nameSpace");
                                                if (msg.getMessageDirection()== MessageDirection.INBOUND)
                             amk = new AuditMessageKey(msg.getMessageId(),AuditDirection.INBOUND);
                          else
                             amk = new AuditMessageKey(msg.getMessageId(),AuditDirection.OUTBOUND);
                                                XMLPayload xp = msg.getDocument();
                          Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"AO: Now got the xml payload object.");
                          if (xp != null)
                                  Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"AO: Now calling the Convert Method to convert Excel to XML.");
                                  byte by[] = convert(xp.getContent(),msgType,nameSpace);
                                  Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"AO: Conversion Done Successfully.");
                                  xp.setContent(by);
                          imd.setPrincipalData(msg);
                          Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"AO: Principle data is set successfully.");
                   } catch (Exception e)
                        Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"AO: Module Exception Caught .");
                        ModuleException me = new ModuleException(e);
                        throw me;
                   return imd;

  • Regds : Adapter modules and custom modules

    Based on which criteria, we will start working towards custom and adapter modules

    Hi praveen,
       There is no specific criteria on which the adapter modules have to be developed.The only criteria is the Business requirement.SAP ships the Ready to use adapter modules to enchance the functinalities of Available Adapters.
    Ex: There is a Adapter module called ZIP bean that can ZIP the files that have been received on the target side .Simlilary there are about 9 SAP provided modules which can meet certain business requirement.
      If u like to have ur own u can develop one and go ahead.So many Giudes are available in SDN for that.to get an idea.
    Please refer the followig links .Hope this is useful
    http://help.sap.com/saphelp_nwpi711/helpdata/en/fd/16e140a786702ae10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nwpi71/helpdata/en/8b/895e407aa4c44ce10000000a1550b0/content.htm
    Thanks,
    Ram.

  • 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

  • IMessage - how to show if someone received and read the sent message?

    Hi,
    I'm trying to figure out how to see when I sent a iMessage to someone if they have received it and "read" it.  I know in settings there's an option that shows others when I have read their messages.  Do they have to have this turned on in order for me to see this?

    Yes, as far as I know, they do. I enabled the setting on my phone and my husband's because it's nice to see when he read my message. (I doubt he pays attention to that feature, but it's important to me.) I haven't used iOS with anyone else yet. Apparently none of my iPhone owning friends have updated to iOS 5 yet.

  • Siri cannot  check  for the new emails and read new text messages cannot play radio

    When I asking Siri for read new text message or check my mail box, she just for text does not see
    and for mail checking but old, what I refresh manual.
    She also cannot start playing ITunes Radio.
    It because iOS 7 in beta.

    Hi there,
    You may find the troubleshooting steps in the article below helpful.
    iOS: Troubleshooting Siri
    http://support.apple.com/kb/TS4079
    -Griff W. 

  • Function Module Undefined during message mapping.

    Hi,
    My Scenario is Idoc to Multiple Files without any condition i have to drop 2 files at the 2 differient directories of  FTP,
    So we are using PI 7.1 and in the Message Mapping using Signature Tab we have added 2 Target messages and at the source we have used the IDOC.
    When we see the structure under Definition Tab in Message Mapping, We are facing the below error
    "FUNCTION MODEL UNDEFINED"
    So can anyone suggest what could be the problem, do i need to change any occurence in the signature tab for the message types else what shuld i do to get the structures in the Definiton Tab.
    Please suggest how to approach this..
    Thanks,
    --Kishore

    My Scenario is Idoc to Multiple Files without any condition i have to drop 2 files at the 2 differient directories of FTP,
    1. Use multi mapping - /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible
    2. use two different inbound interfaces, and do two different interface determination without conditions for the same receiver determination

  • File Adapter Writting and Reading strategy

    Hi All,
    When i am trying to write data to file, it was opened by another person and it gave error in the receiver communication channel saying like source is using by another application. Which is well and good
    But in case of Sender channel while writing the data to file even thought it is opened by another person, Sender file adapter is picked the file.
    I didn't get the reason why it is like this. Any one of u had the same issue???
    Regards

    Hi Neetesh,
    >>hmm ... that's weird ... you mean to say that the polling frequency is now (20 + 100) = 120 secs ? Unless and until the file is not being modified or the file is not "open", this parameter shouldn't work ...
    Examples
    Poll interval is 20 sec and MSecs to wait is 100000( 1 MIN 40 Sec)
    1) If file is there and did not opened / modifying
    waiting till 1 min 40sec to pick the file
    2) If the file is there and Modifying it
    Adapter is waiting 1 min 40sec if the files have been changed.
    3) If there is a file and just opened, not writing any files
    Waiting for 1 min 40 sec to pick the file
    >>Can you share the adapter log?
    Processing Details for Cluster Node Server 0 10_31463
         5/20/10 3:49:56 PM           Polling interval started. Length: 20.0 seconds
         5/20/10 3:49:56 PM           Processing finished successfully
         5/20/10 3:49:56 PM           Processing started
         5/20/10 3:49:56 PM            4f1e0c5b-9553-4397-30ef-d3bb55a13a48     Processing finished successfully
         5/20/10 3:49:55 PM            4f1e0c5b-9553-4397-30ef-d3bb55a13a48     Message with ID 4f1e0c5b-9553-4397-30ef-
                                                   d3bb55a13a48 processed
         5/20/10 3:48:15 PM           Processing started
         5/20/10 3:47:55 PM           Polling interval started. Length: 20.0 seconds
         5/20/10 3:47:55 PM           Processing finished successfully
         5/20/10 3:47:55 PM           Processing started
         5/20/10 3:47:35 PM           Polling interval started. Length: 20.0 seconds
    Regards
    Edited by: Vamsi Krishna on May 20, 2010 10:50 PM

  • Siri and reading new text messages.

    Why is Siri no longer responding "would you like to reply or read again" after reading back a new text message?

    I never said there wasn't a change. What you expect and what Apple is planning or doing may not always be the same thing.  Speculation is prohibited on these forums but, I'll repeat what I said before and hope you can figure it out: Apple has said there will be new features and improvements in Siri with iOS 7. Sometimes, features get removed for various reasons in beta products and are put back in the later releases.
    And, since you've never beta tested a product for two years, you must not have used Gmail until rather recently.

  • PI 7.1 Adapter Module - meaning of VERSION_ID and serialVersionUID?

    Hi!
    I am currently developing my first PI Adapter Module. In SAP sample coding GetHostName I find the following declarations and I ask me what's the meaning and/or purpose of these declarations:
    public static final String VERSION_ID = "$Id://tc/aii/30_REL/src/_adapters/_sample/java/user/module/GetHostName.java#1 $";
    satic final long serialVersionUID = 7435850550539048631L;
    And additionally how I have to declare these two variables for my adapter module ... This comes true especially for VERSION_ID, because serialVersionUID can be generated by NWDS using quick fix feature. It then declares such a variable ...
    Thanxs for any hint in advance!
    Regards,
    Volker

    Hi Pavel,
    public - this is the visibility modifier (it means that the body method can be call by any outside method)
    static - the method is a static instance of the class. Not sure what exactly it does though.
    final indicates that the value of the variable won't change - in other words, a variable who's value can't be modified after it is declared.
    Use public final static String when you want to create a String that belongs to the class (no instance necessary to use it), and that won't change, for instance when you want to define a Stringconstant that will be available to all instances of the class, and to other objects using the class, depending on the access modifier:
    public final static String MY_CONSTANT = "SomeValue";  // ... in some other code, possibly in another object, use the constant: if (input.equals(MyClass.MY_CONSTANT)
    All the variables are implicitly public static final in a Java Interface.
    Is it a good coding practice to use public static final in constant variable although it is declared inside an Interface.
    For example :
    public interface TestInterface{  public static final String EX_CONSTANT = "ABC"; public static final int EX_INT_CONSTANT = 5; public static final double EX_DOUBLE = "5.0"; public static final Integer EX_INTEGER = 10;  }
    Refer below links
    http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/09/24/setting-queue-dynamically-using-adapter-module
    http://f0j00fec.benxbrain.com/en(bD1lbiZjPTAwMQ==)/index.do?onInputProcessing(brai_object_thread)&001_threadid=89626&001_boardtype=01&sysid=PI1&pgmid=R3TR&object=DTEL&obj_name=VERSION_ID&child_param=
    Hope it will helpful..
    Regards
    Bhargava krishna

  • Adapter Modules: Set parameter values dynamic?

    Hi everybody,
    is it possible to set parameter values in adapter modules dynamic?
    Thanks Regards
    Mario

    Hi all,
    thanks for your replies.
    My problem is not solved.
    To make it clear,
    I want to set an attachmentName in Mail receiver adapter WITHOUT using the MailPackage.
    This is possible:
    ModuleName:        localejbs/AF_Modules/MessageTransformBean
    ModuleType:        LocalEnterpriseBean
    ModuleKey:        CHAN
    Parametername:        Transform.ContentDisposition
    ParameterValue:        attachment; filename="NameOfAttachment.txt"
    I want to set "NameOfAttachment.txt" dynamically. How can I achieve this? Thanks, regards
    Mario

  • 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>

Maybe you are looking for

  • In Address book print window opened too large for window.  Unable to close

    Using Address book,   trying to print lables for a group, print window opened to large for window.... cannot cancel or close out.

  • Setting up FaceTime for Mac

    I've successfully installed FaceTime on my 27" iMac using my Apple ID and MobileMe email address. Tried to do the same with my wife's Apple ID and MobileMe on my second iMac (a 21.5") but to no avail. Ditto with my daughter's Apple ID and MobileMe em

  • A question about Dynamic News Sample.

    I have encountered a error when I installed Dynamic News Sample and build it in JDeveloper3.1. The main environments are: Oracle8.1.6, Java1.2 , Oracle XML Parser2 for Java , Oracle XSU12. The error is: "method endElement(java.lang.object) not found

  • PR  mandatory to create PO

    hi all what are the settings needed to make PR mandatory for PO.i tried with Authorization for buyers in conf but still i can create PO manually

  • How to set the default values for fields

    Hi all, How to show the default values without changing the existing code in the CO for the seeded page. I have requirement like one drown box in that three values are there. On page load the item is empty , but i have to show first value as default