Change Response in Adapter Module

Hi all,
    In asynchronous senario, there would be a http status 200 response from the receiver if the message has been arrived the receiver system. I'm wondering, is it possible to change the response manually by develop a adapter module?
Thanks and B'Rgds,
YiNing

I'm using a soap adapter.
Q: What should my web service return to the adapter for asynchronous calls?
           A: Currently, the receiver adapter expects an HTTP 200 with a SOAP envelope with an empty content for successful delivery. Any other response will result in a XI system error and triggers retries of the message. When you want to check duplicates, you should configure your receiver channel to pass the XI message header information to the server.
           Prior to SP11, a SOAP fault resulted in the application or system error, depending on whether the SOAP fault contained a detail child element or not. This behavior contradicted the communication model. Therefore, it has been changed so that the adapter generates the system error for any SOAP fault in asynchronous calls.
           When you want to check duplicates in your web service, you should configure your receiver channel to pass the XI message header information to the server. When your web service indeed find a duplicate, assuming that the previous message was simply lost, your web service should return an HTTP 200 with an empty SOAP envelope.

Similar Messages

  • Change "subject" in Receiver Mail Adapter Module

    Hi all,
    following the "How To Guide" I developed a Module for my receiver mail adapter. Everything works fine.
    Now my question: is it possible to change the content of the mail-"subject" in the module?
    Your help is appreciated.
    Carmen

    Hi Stefan,
    maybe I should describe my problem more detailed:
    My scenario is RFC-XI-Mail. I use the mail package to determine the receiver of the mail dynamically. Another thing I want to do, is to attach a file to this mail which is located on the server. So far so good.
    My problem is, that the name of the file (which I need in my adapter module) changes for every mail. So what I need is the possibility to deliver it to the adapter module.
    I found out that it is possible to read the payload. So my idea was to hand it over in one of the fields like "subject". But now I want to change the subject afterwards...(delete the filename).
    Maybe you have another idea?
    Regards
    Carmen

  • Changing source file for file sender adapter in adapter module

    Hi guys!
    3rd party partner send us files, which are not acceptable by file adapter, so we need to implement (I suppose) adapter module in file sender adapter to correct the file format before it is taken by standard adapter. I have no experience in this development field. Could you give me:
    1, whether it is possible (changing file contents before it is taken by standard file sender adapter)
    2. any ideas, where to start with the development (pdf with info etc.)
    Thanx a lot!
    Olian

    <i>2. any ideas, where to start with the development (pdf with info etc.)</i>
    >>>>>
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/02706f11-0d01-0010-e5ae-ac25e74c4c81
    <i>1, whether it is possible (changing file contents before it is taken by standard file sender adapter)</i>
    >>
    yes you can achieve this in the logic in a module

  • Adapter Module: How to see if Msg is Request or Response in Sync process?

    Hi all,
    I have created an adapter module. It works fine, in my case on NW07.
    This module is called twice in a synchronous processing as described in
    http://help.sap.com/saphelp_nw2004s/helpdata/en/a4/31d940f52f7e7fe10000000a1550b0/content.htm
    and additionally with more details here
    http://help.sap.com/saphelp_nw2004s/helpdata/en/a4/f13341771b4c0de10000000a1550b0/frameset.htm
    In a synchronous scenario one can see that modules are called in a special sequence twice. First for the request, second for the response.
    My question:
    A: How can I tell the Module Processor to call my Module only once?
    or
    B: How can I check within the module wether my message is a request or a response. this way offers the posibility to skip handling based on rules eg. req/resp.
    Kindest regards Joerg Hopmann

    Hi all,
    I have to add, that in normal cases an adapter module is called only once, I know, but I have my adapter module in the JMS-Adapter inserted.
    And while using the feature of the Reply-Queue one can use the JMS-Adapter for synchronous processing. And in this specal case my module is called twice. Independent of the position within the list of modules.
    Regards Joerg Hopmann

  • REG : Can we change namespace using any adapter module.

    Hi All,
               I was working on the XMLAnonymizerBean adapter module. his module provides us the functinality of changing the prefix of namespace and selecting  sprecified modules in the output XML. Now i am stuck with a question ie is there any module that can change the namespace in the output xml. for example :
    xmnls :  namespace1 to
    xmnls : namespace 2.

    Hi,
    You can use a simple XSLT mapping in Receiver adapter . check this blog
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=%28J2EE3417100%29ID0975923150DB01234155231841994144End?blog=/pub/wlg/2620
    Provide the actual namespace in the bleow code
    <?xml version='1.0' ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:p2="provideyournamespace">
         <xsl:template match="/">     
                       <xsl:copy-of select="*"/>
         </xsl:template>
    </xsl:stylesheet>
    Regards
    Suraj

  • Problem changing XML element in Adapter Module

    Hey!
    I am developing an adapter module to transform a coded password back to clear text. I have access to the XML element where the password is and I get to transform it, but I have 2 problems as also stated in the code:
    1) I cannot set the new value back to the node. I try with
    firstNode.getFirstChild().setNodeValue(decodedPwd);
    but this does not seem to work. How can I achieve this?
    2) Between the first issue and the code
    msg.setDocument(xmlpayload);
    I am not sure how to get my new values for the node back in the XMLPayload. How can I achieve this?
    Here is the code:
    msg = (Message) inputModuleData.getPrincipalData();
              XMLPayload xmlpayload = msg.getDocument();
              factory = DocumentBuilderFactory.newInstance();
              DocumentBuilder builder = factory.newDocumentBuilder();
              Document document = builder.parse((InputStream)xmlpayload.getInputStream());
              password = (Element)document.getElementsByTagName("ns1:passord").item(0);
              firstNode = password.getFirstChild();                    
              pwd = firstNode.getNodeValue();
              if(pwd != null){
                   decodedPwd = Decoder.decodeString(pwd);
    // THIS FAILS!
              firstNode.getFirstChild().setNodeValue(decodedPwd);
    //HOW TO SET NEW NODE VALUE TO XMLPAYLOAD HERE?
              msg.setDocument(xmlpayload);
              inputModuleData.setPrincipalData(msg);
                   return inputModuleData;          
    Help is much appreciated!
    Thanks!
    regards Ole

    Hey!
    The problem was solved. The code snipped I found was:
                   DOMSource DOMSource = new DOMSource(document);
                   ByteArrayOutputStream myBytes = new ByteArrayOutputStream();
                   Result dest = new StreamResult(myBytes);
                   TransformerFactory tf = TransformerFactory.newInstance();
                   Transformer serializer = tf.newTransformer();
                   serializer.transform(DOMSource, dest);
                   byte[] docContent = myBytes.toByteArray();
                   xmlpayload.setContent(docContent);
                   msg.getDocument().setContent(xmlpayload.getContent());               
    Ole
    Edited by: Ole Mugaas on Mar 27, 2008 8:43 PM

  • ModuleData.getPrincipalData returns null in the adapter module development

    Hi gurus,
    i am doing a test on the adapter module development following an article written by William Li:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0ac06cf-6ee2-2c10-df98-e17430ca5949?QuickLink=index&overridelayout=true
    my problem is after the EJB has been deployed, it seems that the return of inputModuleData.getPrincipalData() is always null which makes the program can not get the xml payload from the framework.
    the main process of the example has been simplified like this:
         public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData) throws ModuleException {
              Object           obj = null;
              try {
              obj = inputModuleData.getPrincipalData();
              Message     msg1 = (Message) obj;          
                    XMLPayload xmlpayload = msg1.getDocument();}          
              catch (Exception e) {
                   ModuleException me = new ModuleException(e);
                   throw me;
              return inputModuleData;
    after deployed, i get the following error in the adapter monitor of RWB: (my JNDI is testtest)
    17.02.2012 17:13:44.643 Information Send binary file  "test8.xml" from FTP server "10.18.48.150:/encrypt_test/", size 206 bytes with QoS EO
    17.02.2012 17:13:44.644 Information MP: processing local module localejbs/CallSapAdapter
    17.02.2012 17:13:44.644 Information Application attempting to send an XI message asynchronously using connection File_http://sap.com/xi/XI/System
    17.02.2012 17:13:44.645 Information Trying to put the message into the send queue
    17.02.2012 17:13:44.648 Information MP: processing local module localejbs/testtest
    17.02.2012 17:13:44.648 Error MP: exception caught with cause java.lang.NullPointerException: while trying to invoke the method com.sap.engine.interfaces.messaging.api.Message.getDocument() of an object loaded from local variable 'msg1'
    whereas if the code has been changed like this:
         public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData) throws ModuleException {
              Object           obj = null;
              try {
                   obj = inputModuleData.getPrincipalData();
                   Message     msg1 = (Message) obj;     
                   if (obj != null )
                        XMLPayload xmlpayload = msg1.getDocument();
              catch (Exception e) {
                   ModuleException me = new ModuleException(e);
                   throw me;
              return inputModuleData;
    the file can be read by the file adapter.
    i just quite confused that why the return of the getPrincipalData() is null? where is the problem? thanks
    Edited by: Stephen Xue on Feb 17, 2012 5:22 AM

    I'm gonna reply to myself here. I changed the processing sequence of the adapter modules in the  in the FileSender channel so that my module comes first then CallSapAdapter. Then getPrincipalData() contains the message.
    Hope this helps someone else.

  • 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

  • Adapter Module Migration in PI 7.1

    Hi,
    I have migrated some code for Adapter Module from PI 7.0 to PI 7.1. I have deployed the SDA file on the server and it was successful. But in the communication channel monitoring i am getting below exception.
    Message processing failed. Cause: javax.ejb.TransactionRolledbackLocalException: Exception raised from invocation of public com.sap.aii.af.lib.mp.module.ModuleData com.Demo.JMSadapterModuleBean.process(com.sap.aii.af.lib.mp.module.ModuleContext,com.sap.aii.af.lib.mp.module.ModuleData) throws com.sap.aii.af.lib.mp.module.ModuleException method on bean instance com.Demo.JMSadapterModuleBean@63120b10 for bean sap.com/DemoJMSEARxml|DemoJMSEJB.jarxml|JMSadapterModuleBean; nested exception is: java.lang.NullPointerException; nested exception is: javax.ejb.EJBException: Exception raised from invocation of public com.sap.aii.af.lib.mp.module.ModuleData com.Demo.JMSadapterModuleBean.process(com.sap.aii.af.lib.mp.module.ModuleContext,com.sap.aii.af.lib.mp.module.ModuleData) throws com.sap.aii.af.lib.mp.module.ModuleException method on bean instance com.Demo.JMSadapterModuleBean@63120b10 for bean sap.com/DemoJMSEARxml|DemoJMSEJB.jarxml|JMSadapterModuleBean; nested exception is: java.lang.NullPointerException; nested exception is: javax.ejb.EJBTransactionRolledbackException: Exception raised from invocation of public com.sap.aii.af.lib.mp.module.ModuleData com.Demo.JMSadapterModuleBean.process(com.sap.aii.af.lib.mp.module.ModuleContext,com.sap.aii.af.lib.mp.module.ModuleData) throws com.sap.aii.af.lib.mp.module.ModuleException method on bean instance com.Demo.JMSadapterModuleBean@63120b10 for bean sap.com/DemoJMSEARxml|DemoJMSEJB.jarxml|JMSadapterModuleBean; nested exception is: java.lang.NullPointerException; nested exception is: javax.ejb.EJBException: Exception raised from invocation of public com.sap.aii.af.lib.mp.module.ModuleData com.Demo.JMSadapterModuleBean.process(com.sap.aii.af.lib.mp.module.ModuleContext,com.sap.aii.af.lib.mp.module.ModuleData) throws com.sap.aii.af.lib.mp.module.ModuleException method on bean instance com.Demo.JMSadapterModuleBean@63120b10 for bean sap.com/DemoJMSEARxml|DemoJMSEJB.jarxml|JMSadapterModuleBean; nested exception is: java.lang.NullPointerException
    could you please advise me what could be the problem?
    Please help me out here.
    Best Regards,
    Prasad Babu.

    Hi Prasad,
    please refer to the last paragraph of the CSS note -
    [#1004000 PI 7.1 Adapter/Module Development: API Changes since SP0|http://service.sap.com/sap/support/notes/1004000]
    i.e.,
    "MIGRATION NOTES
    API: NetWeaver04 XI 3.0/7.0 any SP; Documentation: XI 3.0/7.0 any SP
    XI 3.0/7.0 adapter and module implementations cannot be deployed in XI
    7.1. The source code must be adjusted first. Please use the API cross
    reference attached here. Further information can be found in the SAP
    NetWeaver PI  7.1 manual."
    Regards
      Kenny

  • 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

  • Addition of a header line to a flat file using Custom Adapter Module?

    Is the header that you want to add to the input file always a constant?
    In that case why go for a module. Directly map the required constants during the mapping to your IDoc.
    My suggestion is to avoid the module

    Hi Shabrish,
    The Header is not a constant field always as the value changes per file adapter so a module will be helpful, and it will be a must to add the Header record as the first line.
    Can you suggest/direct me to some appropriate blogs? Thanks
    Regards,
    Nipun

  • File sender adapter Module Error

    Hi Everybody,
    I have developed an adapter module for file sender to rename the file name which is picked from the directory and I am getting an error
    "Attempt to process file failed with java.lang.NullPointerException".
    Can anybody tell me why is this error?
    Thanks,
    Zabi

    Hi,
    first check that module has been succesfully executed or not .This you can check in RWB .
    Secondly go in the file adpater and click on to module tab and check
    1-there will be two things one will be adapter module that you have depolyed. other one will be call sap adapter.
    2- make sure that call sap adapter should come after the module you have deployed. and having the key value less then adapter module (let say your adapter module is having the key value 1 and  call sap adpater is having the key value 0 then you need to change the key value there)
    Thanks
    sachin

  • Import  com.sap.aii.mappingtool.* show error in PI 7.1 adapter module

    Hi
    Experts,
    i have an adapter module for 7.0 and i am trying to replicate the same for PI  7.1  in 7.1 NWDS.
    i have made the required changes as mentioned in stefan's blog :/people/stefan.grube/blog/2008/12/11/adjust-your-pi-70-adapter-modules-for-pi-71-in-15-minutes
    but  import com.sap.aii.mappingtool.tf7.rt.Container; shows error , do we need to  inlcude any jar file for this :
    i am using this module to rename file name (in case of pick and place scenario forwithot IR configuration)
    getMessageProperty and setmessageProperty is getting deprecated.(striked off)
    strFileName = msg.getMessageProperty("http://sap.com/xi/XI/System/File","FileName");
    Regards,
    Srinivas

    > strFileName = msg.getMessageProperty("http://sap.com/xi/XI/System/File","FileName");
    in PI 7.1 you can use:
    strFileName = msg.getMessageProperty(new MessagePropertyKey("FileName","http://sap.com/xi/XI/System/File"));
    Note that property name and namspace come in different order. I almost got mad until I noticed
    http://help.sap.com/javadocs/pi/SP3/xpi/index.html

  • Help required in File Adapter Module Development

    Hi All,
    I am working out a File to File scenario where my source file is in some different format. Please find the below sample:
    <Root>
    <ID>100</ID>
    <NAME>SAP</NAME>
    <END-Root>
    Before taking this into IS, I need to change the file to a proper XML format. I need to replace "END-" with "/".
    <?xml version="1.0" encoding="UTF-8" >
    <Root>
    <ID>100</ID>
    <NAME>SAP</NAME>
    </Root>
    I think I can achive this by developing Adapter Modules. I am new to Adapter Module development.
    Can you please tell me if there are any inbuilt Adapter Modules for this. If not please suggest me some relevant blogs to solve this issue. Thanks in Advance.

    Hi Phani Kumar
    There are more than one ways to do this. As per your timelines and skill set you can decide
    1. You can use the XMLAnonymizerBean this is an inbuilt module
    Check Stefen's blog
    Remove namespace prefix or change XML encoding with the XMLAnonymizerBean
    2. You can read this complete file in a single field and then you can create XSLT or Java mapping to parse it in a target XML you desire.
    Check these
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3823 [original link is broken] [original link is broken] [original link is broken](XSLT mapping)
    Java Mapping (Part I) (Java Mapping)
    The specified item was not found. (Java Mapping helper DOM)
    The specified item was not found. (XML Node into string)
    3. You can develop Adapter modules for this
    Refer
    Check Guides
    XI 3.0
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3bdc14e1-0901-0010-b5a9-a01e29d75a6a
    PI 7.0
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f013e82c-e56e-2910-c3ae-c602a67b918e
    PI 7.1
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00838345-708c-2a10-1199-9514c0b0a91c

  • Sender Adapter Module Not Working

    Hi,
    I have changed an existing Sender Adapter Module code and deployed using SDM.
    It was working fine but after some days it is not working as designed. Say for an example, the number of pipes(|) in each record is one less than usual number of pipes. It does not say any error in module but in my java mapping raising GENERIC Exception.
    I had the same problem in Dev and now I am facing the same in QA.
    When I checked the standalone code it is working fine. Any reason for this anomalous behavior?
    Regards,
    Manikandan R

    Hi,
    Could you give us more details about : your coding, input sample when error is raised ?
    That'd help a lot
    Chris

Maybe you are looking for

  • How to display a variable in the message

    Hi all, I am developing an application where I am parking a document, can anyone please tell me how can I display the document number on the web dynpro screen with the message once the document has been parked. So far I have written the following cod

  • More than one solution active ?

    Hello Everyone, I have some enhancements to Opportunity, Accounts and Activity. These enhancements are part of different solutions. That is, Opportunity Extensions are part of one solution, Accounts extensions are part of another and activity in anot

  • Equivalent of alloc_oages in solaris 10

    Hi All, Currently iam porting my linux 10 gig network driver into solaris . I have a question regarding Memory allocation , 1. For performance tuning we directly allocate pages in linux ( using alloc_pages) and just unmap them ( using pci_umap) Is th

  • Can't use the FM radio on my Muvo TX

    <SPAN>When I go into he menu and activate the fm radio functions of my Muvo TX FM, the player shuts itself off, and when I turn it back on it starts up where it last did when I turned it on before. For example, when I turned it on the last time it wa

  • My sound doesn't work

    Hi all, first time poster here and I hope someone can help me out. Earlier I was watching something on my laptop when the sound cut out completely, I've tried restarting a number of times but still no sound. I've disabled and re-enabled the sound car