Message and Java Mapping

Hello -
I have a java mapping and a message mapping implemented in one interface.
Java mapping basically adds a header and does nothing else.
Message mapping has all the mapping. Its not complex but straight.
I have the Message mapping first and then the Java mapping in the Interface Mapping.
what happens is i could see the headers written through Java mapping in my output xml file which is good but i cannot view the message mapping output in the file.
Any ideas.
Thanks,
Tirumal

Hi
I am generating the headers in the java mapping using this:
public void startDocument ()
throws SAXException {               
write("<?xml version='1.0' encoding='UTF-8'?>");
write("<!DOCTYPE cXML SYSTEM 'http://xml.cxml.org/schemas/cXML/1.1.008/cXML.dtd'>");
Maintain Order at Runtime is checked in the Interface Determination.
Ok, in the interface Mapping Editor i get 2 messages:
1.
11:09:48 Start of test
Call method execute of the application Java mapping com.sap.xi.tf._Orders_MM_
Java mapping com/sap/xi/tf/_Orders_MM_ completed. (execute() of com.sap.xi.tf._Orders_MM_
Call method execute of the application Java mapping com.sap.aii.mapping.api.SampleWithSaxParser
Java mapping com/sap/aii/mapping/api/SampleWithSaxParser completed. (execute() of com.sap.aii.mapping.api.SampleWithSaxParser
Executed successfully
11:09:48 End of test
2. XML not well formed
None of the above messages seem to be of Message Mapping don't know why its not getting written in the output.
Thanks,
Tirumal

Similar Messages

  • ABAP and Java mapping

    Wanted to confirm my understaing for ABAP and JAVA mapping.
    Am I correct in my assumption that these mapping techniques can be used only if input and ouput is in XML format ?
    So if XI is receiving a flat comma separated text/non-XML file or an IDOC for that matter and output is NOT in XML format, say again flat text file or IDOC, I cannot use above two techniques?
    All the docs I have read suggest that 'Execute' method is called when XML file/data is received, paresed using DOM/SAX/JAXB (for Java mapping) or IXML lib (for ABAP mapping) and then create a output XML file.
    -Thanks in advance

    Hi Bob,
    Here you have a code sample for deescaping. I have have written this code a couple of time ago. The incoming file can be any text format. It might be XML, but not necessarily.
    The main method is not reqired, but good for testing.
    Regards
    Stefan
    * Created on 28.09.2005
    * To change the template for this generated file go to
    * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    package sample;
    import  com.sap.aii.mapping.api.*;
    import  java.io.*;
    import  java.util.Map;
    public class Deescaping implements StreamTransformation{
              public static void main (String[] args) {
                   try {
                        InputStream in = new FileInputStream(new File("in.xml"));
                        OutputStream out = new FileOutputStream(new File("out.xml"));
                        Deescaping change = new Deescaping();
                        change.execute(in, out);
                   } catch (Exception e) {
                        e.printStackTrace();
              public void setParameter (Map map) {
              public void execute (InputStream in, OutputStream out)
                   throws StreamTransformationException {
                   try {
                        int c;
                        while ((c = in.read()) != -1) {
                             if (c != '&') {
                                  out.write(c);
                             } else {
                                  // ampersand
                                  String help = "&";
                                  boolean exit = false;
                                  // check the next 5 chars, if there is a ';'
                                  for (int i = 0; i < 5 && !exit; i++) {
                                       c = in.read();
                                       if (c == -1) {
                                            exit = true;
                                       } else {
                                            // another ampersand?
                                            if (c == '&') {
                                                 out.write(help.getBytes());
                                                 help = "&";
                                                 i = 0; // check the next 5 chars
                                            } else {
                                                 help = help + (char) c;
                                                 if (c == ';') {
                                                      exit = true;
                                                 if (help.equals("&amp;")) {
                                                      help = "&";
                                                 if (help.equals("&lt;")) {
                                                      help = "<";
                                                 if (help.equals("&gt;")) {
                                                      help = ">";
                                                 if (help.equals("&quot;")) {
                                                      help = """;
                                                 if (help.equals("&apos;")) {
                                                      help = "'";
                                  } // for
                                  out.write(help.getBytes());
                        } // while
                        out.flush();
                   } catch (Exception e) {
                        throw new StreamTransformationException(e.getMessage(),e);

  • XSLT and Java Mapping

    Hello friends,
    Can any one know that how to create a XSLT and Java Mapping file(Jar File).
    I am not able to find any of the example so if you create a example or find some where please let me know on that How to create such files...
    Thanks...
    Gaurav Jain

    Hi,
    I am trying to invoke a Java Extension Function from a XSLT. I added both the class file and the XSLT file to a folder, then zipped the entire folder and uploaded into the Archive for my Interface MApping.
    The CLASS gets loaded but the runtime engine gives an error when calling the JAVA Function.
    Here is what it says:
    Creating mapping sequence with 2 steps. --- Creating Java mapping Deliveries/stringHandler --- Creating mapping sequence with 2 steps. --- Creating XSLT mapping Deliveries/test1 --- Using MappingResolver with context URL /sapmnt/XD1/global/xi/mapping/http%3A%2F%2Fwolterskluwer%2Ecom%2Fxi%2F wk_midas_deliveries%2Ftest/cd2e6820267511d9cb52c3c5143c3524/ --- Loaded class Deliveries.stringHandler --- com.sap.aii.ibrun.server.map.MappingRuntimeException: at com.sap.aii.ibrun.server.map.MappingRuntimeException.code_STYLESHEET_OR_CLASS_NOT_FOUND(MappingRuntimeException.java:91) at com.sap.aii.ibrun.server.map.RUMappingJava.instantiate(RUMappingJava.java:168) at com.sap.aii.ibrun.server.map.RUMappingJava.execute(RUMappingJava.java:41) at com.sap.aii.ibrun.server.map.RUSequence.execute(RUSequence.java:50) at com.sap.aii.ibrun.server.map.RURunner.run(RURunner.java:58) at com.sap.aii.ibrun.server.map.RUManager.run(RUManager.java:66) at com.sap.aii.ibrun.sbeans.map.MappingRequestHandler.handleRequest(MappingRequestHandler.java:67) at com.sap.aii.ibrun.sbeans.map.MappingServiceImpl.processFunction(MappingServiceImpl.java:83) at com.sap.aii.ibrun.sbeans.map.XMappingServiceObjectImpl0.processFunction(XMappingServiceObjectImpl0.java:24) at com.sap.aii.ibrun.sbeans.map.MappingServiceKey.processFunction(MappingServiceKey.java:10) at java.lang.reflect.Method.invoke(Native Method) at com.inqmy.services.rfcengine.RFCDefaultRequestHandler.invokeBean(RFCDefaultRequestHandler.java:83) at com.inqmy.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:50) at com.inqmy.services.rfcengine.RFCJCOServer.handleRequest(RFCJCOServer.java:69) at com.sap.mw.jco.JCO$Server.dispatchRequest(Unknown Source) at com.sap.mw.jco.rfc.MiddlewareRFC$Server.nativeListen(Native Method) at com.sap.mw.jco.rfc.MiddlewareRFC$Server.listen(Unknown Source) at com.sap.mw.jco.JCO$Server.listen(Unknown Source) at com.sap.mw.jco.JCO$Server.run(Unknown Source) at java.lang.Thread.run(Thread.java:513) --
    Please tell me what is the problem?
    Thanks for your time
    A

  • Give me description for ABAP and XSLT and JAVA Mapping

    i want detailed description for XSLT AND ABAP,JAVA Mapping and where they require coding and some examples for this items and differences for these mappings and message mapping and some examples which shows difference between these items

    Hi,
    Java mapping:
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
    ABAP Mapping:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    XSLT mapping
    /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping
    ABAP XSLT mapping
    /people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping
    Regards
    Vijaya

  • When do we go for ABAP mapping and Java mapping

    Hi friends,
                At present I am working on graphical mapping in XI ,can you guys give me with an example or scenario when do we use ABAP mapping , Java mapping or XSLT mapping.
    Thanks in advance
    Sud

    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/forums">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/forums</a>
    I have standard XSLT mapping programs available for my scenarios, so use XSLT mapping. Similarly with Java mapping,  For most scenarios, message mapping does the job too well. Abap mapping similarly is used to leverge existing ABAP base.  If message mapping becomes confusing and hard to follow with too many functions, I go for Java mapping (just my way). I havent used ABAP mapping thus far.
    Discussing ABAP mapping
    ABAP mapping is developed in ABAP work bench. ABAP mapping needs to be transported to integration server and XI does not support this transport and have to do with ABAP transports.
    Customers who can develop mapping program on SAP web AS and can transport them there can use ABAP mapping
    *ABAP mapping programs cannot access the value table
    *Since ABAP mappings are executed on ABAP stack SAP does not provide any ABAP mapping programs
    *ABAP mapping programs must exists with one single version in IS, unlike JAva and XSLT mapping that can have multiple versions of mapping program
    Regards,
    Priya
    priya k
    null

  • How to send response message from Java mapping class? Please help!

    Hi Experts,
      I have a sync scenario
              -Req-->  -
    >
    SOAP           XI       RFC
              <Res--     <-----
      The Req message contains:
      <Order>
           <Orderid>100</Orderid>
           <Desc>Extrenal Order</Desc>
           <Qty>2500</Qty>
      </Order>
      Response message is:
      <Log>
         <LogTxt>Qty value cannot be more than 3 chars</LogTxt>
      </Log>
      In the XI I have to validate the input request message using a schema. For this I am writing a java mapping program using aii_map_api.jar.
    My requirement is that If the input message schema validation fails then I want to send a response message back to sender.
      How can I send a response message back to the sender in java mapping program?
    Kindly help with sample code example.
    Thanks
    Gopal

    Hi,
    First, I think PI 7.1 has this functionality and perhaps it comes in a SP for PI 7.0 and XI 3.0.  So first have a look at that before creating custom development.
    Second, if you use the java mapping, you will only have access to a request or response message.  I would advise using a custom java module in the module processor and insert this message in the sender communication channel.  This will allow you to validate request and send a response.
    Regards,
    Yaghya

  • PI 7.4 Single Stack - OS Command and Java Mapping Trace

    Hi,
    Since ABAP stack is not avilable how to use the OS command and also want to know how to check the trace for java mapping since sxmb_moni is not avilable.
    Please send me some link for 7.4 or 7.31 single stack document.
    Thanks
    Jignesh shah

    Jo Jignesh,
    Please see the document below.
    Mapping Trace in SAP PI 7.31 Single Stack
    Regards,
    Jannus Botha

  • Windows messages and Java

    Hi there,
    I'm currently converting a C++ application into Java.
    My main problem is that the C++ application uses windows messages to communicate between functions.
    For the C++ users it uses SendMessage() and PostMessage() methods to do this.
    My main question is, is there a equivalent in Java to do this, so sending and retrieving windows messages in Java.
    Thanks in advance....

    Sorry, you're confusing me (not that it's hard to do).
    You're throwing out "application", "server", and "client" in such a way that it's hard for me to understand exactly what you're doing.
    When you say "server", it makes me think of a Java app that is started and stays up, listening on a particular port for a particular protocol. Other machines on the network are the "clients" in this case. They agree to send messages using the agreed-upon protocol to the "server" listening on that port.
    "send and catch messages between programs" doesn't sound like they're running in the same JVM. These sound like networked objects.
    You can use Java's RMI to set up distributed objects that use RMI-IIOP as the default protocol.
    Is that what you want?

  • ABAP Mapping and Java Mapping

    Hello
      Folks
         I have business requirement as below.
       X is a FMCG (Fast moving consumer Good) company. Need to take the financial transaction from customers per day 1 Million.
       When X company takes an electronic cash (Credit card). It need to communicate with X1 (Bank with legacy system).
    My question:
      Ideally what kind of mapping makes my Integration process an error free. Say less monitoring work. Less support.
       Basically I am looking for a RUGGED mapping process.
    Thanks in advance for your answer and co-operation
    Regards
    Ashok Babu

    Hi Babu,
    <b>Ideally what kind of mapping makes my Integration process an error free. Say less monitoring work. Less support.</b>
    Thats depends upon ur requirement.Best is to use Graphical mapping as it is easy to use and not that much complex compare to other mappings.But some in some complex scenario..JAVA/XSLT maaping is useful....
    Check here the mapping performance...
    /people/udo.martens/blog/2006/08/23/comparing-performance-of-mapping-programs
    regards
    BILL
    Use a Good Subject Line, One Question Per Posting - Award Points

  • Java mapping in ccBPM works in PI 7.0 but fails in PI 7.1

    Hi guys,
    at the moment we are upgrading form SAP PI 7.0 to SAP PI 7.11.
    In a scenario for processing of incoming orders we use an ccBPM.
    In this ccBPM there is an mapping where the original xml document of the order are combined with some
    additional information form an web service (multi mapping 2 => 1)
    The result of this mapping is processed further to create an sales order in the backend.
    The multi mapping an java mapping is used.
    Now we are testing the scenario with PI 7.11 and it fails at this mapping step.
    in the workflow log following error occurs.
    An exception with the type CX_ST_MATCH_ELEMENT occ urred, but was neither handled locally, nor de
    Message no. W8899
    I tested the same message on out SAP PI 7.0 system and the whole ccBPM works well.
    When I extract the 2 messages from workflow log and paste them into the test tab of the operation mapping of Enterprise Service Builder of SAP PI 7.11, surrounding by the envelope used by multi mappings
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
       <ns0:Message1>
                   XML MESSAGE 1
       </ns0:Message1>
       <ns0:Message2>
                   XML MESSAGE 2  
       </ns0:Message2>
    </ns0:Messages>
    the mapping works without error, but at runtime it fails, throwing the error mentioned above.
    What could be the reason for this error?
    Does the multi mapping change in PI 7.11 at runtime?
    Could it be a problem parsing the multi message?
    Any help appreciated.
    Kind regards
    Jochen

    Hi Raja,
    thanks for your suggest.
    I know this issue, the java class files are compiled using jdk 1.5.
    We made some more tests.
    e.g. created an dummy ccBPM with two mappings, one two spilt the incoming message in two messages (graphical message mapping) and one to merge this two messages to one message again (java mapping)
    the mapping works at design time on test tab, but fails with the same error at rumtime.
    Also we tested one single operation mapping with this two mappings (split via graphical mapping and merge via java mapping)
    This works also at design time but fails at runtime with a similar error shown in smq2
    The error message is Error ST_MATCH_FAIL occured. P1=element-start P2=M
    we tried to add the whole incoming message to the trace by
    getTrace().addWarning()
    but an trace object is never created in for this step in the workflow log.
    it seem whether you can not add trace messages using the command or that the error occures before this command will be used.
    Kind regards
    Jochen

  • Abap & java mapping

    Can any one give me the simple file 2 file scenario with abap and java mapping?

    Hi Venugopal,
    <u><b>
    ABAP Mapping
    </b></u>I suggest you also go through these links to know more on ABAP Mapping:
    https://websmp101.sap-ag.de/~sapdownload/011000358700003082332004E/HowToABAPMapping.pdf
    /people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi
    /people/r.eijpe/blog
    ABAP Mapping Vs Java Mapping.
    Re: Message Mapping of type ABAP Class not being shown
    Re: Performance of mappings (JAVA, XSLT, ABAP)
    Refer to following SDN Demo which explains the need and how to do the ABAP mapping.
    https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/110ff05d-0501-0010-a19d-958247c9f798#jdi [original link is broken]
    This document will help you to create ABAP Mapping.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e3ead790-0201-0010-64bb-9e4d67a466b4
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/3.0/how%20to%20use%20abap-mapping%20in%20xi%203.0.pdf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    <u><b>
    JAVA Mapping</b></u>
    These are two article links on Java mapping i hope this will help u:
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/java%20proxies%20and%20sap%20xi%20-%20the%20inside%20story%2c%20part%201.pdf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/java%20proxies%20and%20sap%20xi%20-%20the%20inside%20story%2c%20part%20ii.pdf
    Also go through these Blogs,
    /people/ravikumar.allampallam/blog/2005/06/24/convert-any-flat-file-to-any-idoc-java-mapping
    /people/michal.krawczyk2/blog/2005/02/25/simple-java-code-in-graphical-mapping--xi
    Regards,
    Abhy

  • File to Idoc : Java Mapping

    Hi Experts,
    The scenario is file to idoc. In the file i'll be getting name,value pairs. For ex:
    Structure is
    MT
    ....Root(1..unbounded)
    ............Name
    ............Value
    File contains:
    Vishal....1
    Raj.........2
    RFC......10
    Rahul.....20
    Azhar....15 and so on..
    I need to loop through the file. When Name="RFC", I need to make an RFC call with Value as it's input. RFC returns 4 values which will be used for mapping.
    Then I need to continue looping through the file. On encountering a particular Name, I need to map corresponding Value to target field.
    For this, I should have 2 mappings. One to read the file and the other for mapping. I've never used RFC and Java mapping, Can someone provide me a link or a solution for this?
    Thanks,
    Vishal

    Hi,
    You can do this using a UDF.
    first let the source message contain first line and last line which you want to eliminate.
    change the context of the Value to MT ..
    start a for loop in UDF ignoring first & last line like
    for(int i = 1; i< input.length() - 1; i++)  // here i = 1 & not zero  & input length is -1 so that first & last field eliminates
           //carry on string operation to separate name & value on delimeter space
    String name = input<i>.subString(0,.... to the indexOf space);
    //similar for value also....
    now you have name & value
    check for name == 0052
    if(name == 0052)
      perform rfc lookup
    else

  • Fill Container Object in Java Mapping

    Hi Everyone,
    I use BPM and defined a container object of type integer. Now I want to fill this container object in Java Mapping. After I fill it in the next step there is a switch using the value of the container.
    How can I fill the container in Java Mapping?
    Thanks for the input.

    How can I fill the container in Java Mapping?
    Mandatory to fill the container in JAVA Mapping? If not then you can try the below:
    1) Define a Container Object...already done
    2) Let the JAVA Mapping create the required message....transformation step.
    3) include a Container Operation before the Switch step (and after the Transformation)
    4) Mode as Assign...Target will  be your Container Object (integer)....Expression will be the node from the output message of JAVA mapping.
    Regards,
    Abhishek.

  • Message Mapping ...  ABAP ,XSLT and JAVA

    HI Friends
    I have a general question ... but it will confuse me a lot ....
    my question is we have four types of message mappings
    1) GUI ( and UDFs)
    2) ABAP
    3)XSLT
    4) JAVA
    when we have plenty of options in GUI (and User defined functions also)  to define sender 2 receiver message mapping
    then what is need of JAVA,ABAP and XSLT Message Mapping and when we use these message mappings( exactly in which situation) and difference b/w them
    Thanks in Advance
    Mahesh

    Green = recommended
    Yellow = Acceptable
    Red = not recommended
    In my experience.
    XSLT mapping: is confotable to convert to another format different to xml(when we do not have a complex logic)
    Java Mapping: is to implement complex logics(but the maintainbilityis not good...you need a external tool)
    ABAP mapping: I think is the best option when the you have the skills on that technology but take account that is not portable neither good for usability.
    Regards
    Ivan

  • Explicity mapping between ActionScript and Java objects for the BlazeDS Messaging Service

    The BlazeDS documentation shows how to explicitly map between ActionScript and Java objects. For example, this works fine for RPC services, e.g.
    import flash.utils.IExternalizable;
    import flash.utils.IDataInput;
    import flash.utils.IDataOutput;
    [Bindable]
    [RemoteClass(alias="javaclass.User")]
    public class User implements IExternalizable {
            public var id : String;
            public var secret : String;
            public function User() {
            public function readExternal(input : IDataInput) : void {
                    id = input.readObject() as String;
            public function writeExternal(output : IDataOutput) : void {
                    output.writeObject(id);
    and
    import java.io.Externalizable;
    import java.io.IOException;
    import java.io.ObjectInput;
    import java.io.ObjectOutput;
    import java.util.HashSet;
    import java.util.Iterator;
    import java.util.Set;
    public class User implements Externalizable {
        protected String id;
        protected String secret;
        public String getId() {
            return id;
        public void setId(String id) {
            this.id = id;
        public String getSecret() {
            return secret;
        public void setSecret(String secret) {
            this.secret = secret;
        public void readExternal(ObjectInput in) throws IOException,
                    ClassNotFoundException {
            id = (String) in.readObject();
        public void writeExternal(ObjectOutput out) throws IOException {
            out.writeObject(id);
    If I called an RPC service that returns a User, the secret is not sent over the wire.  Is it also possible to do this for the messaging service? That is, if I create a custom messaging adapter and use the function below, can I also prevent secret from being sent?
    MessageBroker messageBroker = MessageBroker.getMessageBroker(null);
    AsyncMessage message = new AsyncMessage();
    message.setDestination("MyMessagingService");
    message.setClientId(UUIDUtils.createUUID());
    message.setMessageId(UUIDUtils.createUUID());
    User user = new User();
    user.setId("id");
    user.setSecret("secret");
    message.setBody(user);
    messageBroker.routeMessageToService(message, null);

    Hi Martin. The way that AMF serialization/deserialization works for BlazeDS is the same regardless of which service is being used, so yes that code will work for messaging as well. On the server, the serialization/deserialization of messages happens at the endpoint. For an incoming message for example, the endpoint deserializes the message and then hands it off to the MessageBroker which decides which service/destination to deliver the message to.
    That was a good question. Thanks for asking it. Lots of people are used to doing custom serialization/deserialization with the RPC services (RemoteObject/RemotingService) but I'm not sure everyone realizes they can do this for messaging as well.
    -Alex

Maybe you are looking for