Java Mapping with an xml array as input

Hi Gurus,
I have to perform a java mapping to map some input xml contained in an array with a target message type. I have found a good java mapping example here:
Re: Please provide Java Mapping example
but my mapping input is not a single XML, but an XML array, thus I have a doubt...
How can I map multiple XML contained in an array with a target XML? I have to solve this problem into a Java mapping prospective.
Thanks to all!
Message was edited by:
        Gabriele Morgante

Hey Stefan, I think he is refering to a n:1 multimapping.
If that is indeed the case, Gabriele, you will have to consider the initial tags inserted by mapping runtime to treat multimappings.
Suppose your XML message is like
<myMT xmlns="urn:mynamespace">
  <value>xpto</value>
</myMT>
Then, if your source message interface occurrence is defined as unbounded in your interface mapping, your mapping program (message mapping, xslt, java mapping, whatever) will receive, from mapping runtime, a message like this:
<Messages xmlns="http://sap.com/xi/XI/SplitAndMerge">
  <Message1>
    <myMT xmlns="urn:mynamespace">
      <value>xpto1</value>
    </myMT>
    <myMT xmlns="urn:mynamespace">
      <value>xpto2</value>
    </myMT>
    <myMT xmlns="urn:mynamespace">
      <value>xpto3</value>
    </myMT>
  </Message1>
</Messages>
Also, if you have more than 1 message type as source of your interface mapping, your mapping program will receive the other message types in <Message2>, <Message3>... tags.
The <Messages> and <MessageX> tags will always be automatically generated by mapping runtime when dealing with multimappings, which are mappings from m XML messages to n XML messages, with either m, n or both different of 1 (note that this definition includes mappings from 1 type to 1 type, when either source, target or both message types have max occurrence = ubounded).
Finally, remember that the output that your mapping program generates will also have to include these <Messages> and <MessageX> tags (with proper namespace), since mapping runtime will be expecting them. Message mappings treat those by default, but your xslt and java multimappings will have to explicitely include these tags in the output.
Regards,
Henrique.

Similar Messages

  • XSLT-transformation in Java-Mapping with javax.xml

    Hi,
    we wanna use javax.xml for transformations in Java-Mapping.
    Inside the Java-mapping we read in XSL-files to transform a XML-stream. With XSLT 1.0 everything works fine - but with XSLT 2.0 we are getting runtime errors.
    Is it possible that javax.xml only supports XSLT 1.0?
    Regards
    Wolfgang

    Hi ,
    Jaxp 1.3 is available in this link -
    http://java.sun.com/webservices/jaxp/
    Use these jar files to process XSLT 2.0.
    Nanda

  • Java Mapping with Stream API

    Hi,
      Can you please let me know when java mapping with STAX will be supported in Netweaver XI?
    Regards
    Sudhir

    Hi Sudhir,
      STAX is Stream API for XML. It works similar to SAX but is a pull based model. It can also work with multiple XSD's...
    XI support of STAX will moslty be supported when XI supports Java EE 5. We can say that this will be supported very soon...
    http://www.xml.com/pub/a/2003/09/17/stax.html presents the overview of STAX.
    Hope this helps
    Regards
    Kiran..

  • Error in Java Mapping for Single XML conversion

    We are working on ABAP Proxy --> SAP PI 7.1 --> SOAP (Synchronous Scenario).
    (ECC -> PI -> Legacy CRM)
    Client has provided a WSDL with Single Node of XML and asking us to pass the whole structure as an single string along with all the nodes of data structure. To perform mapping we are using Java Mapping.
    Message which we are getting after Java Mapping:
    Input
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_SOReject_Sender xmlns:ns0="http://MTSINDIA/TC/SalesOrderReject">
       <ITEM>
          <sSlsOrderCode>1001</sSlsOrderCode>
          <sDlrCode>A250</sDlrCode>
          <sRejectReason>Z2</sRejectReason>
          <nCircleCode>2</nCircleCode>
       </ITEM>
    </ns0:MT_SOReject_Sender>
    Output
    <?xml version="1.0" encoding="UTF-8"?><MT_Trg xmlns:ns="urn:Test_File_to_File"><stringinp>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;ns0:MT_SOReject_Sender xmlns:ns0="http://MTSINDIA/TC/SalesOrderReject"&gt;&lt;ITEM&gt;&lt;sSlsOrderCode&gt;1001&lt;/sSlsOrderCode&gt;&lt;sDlrCode&gt;A250&lt;/sDlrCode&gt;&lt;sRejectReason&gt;Insufficient Stock Balance&lt;/sRejectReason&gt;&lt;nCircleCode&gt;2&lt;/nCircleCode&gt;&lt;/ITEM&gt;&lt;/ns0:MT_SOReject_Sender&gt;</stringinp></MT_Trg>
    Is ther any way from which we can convert &gt; as u201C>u201D and &lt; as u201C<u201D.  Required result is as follows
    Required Output
    <?xml version="1.0" encoding="UTF-8"?><MT_Trg xmlns:ns="urn:Test_File_to_File"><stringinp><?xml version="1.0" encoding="UTF-8"?><ns0:MT_SOReject_Sender xmlns:ns0="http://MTSINDIA/TC/SalesOrderReject"><ITEM><sSlsOrderCode>1001</sSlsOrderCode><sDlrCode>A250</sDlrCode><sRejectReason>Insufficient Stock Balance</sRejectReason><nCircleCode>2</nCircleCode></ITEM></ns0:MT_SOReject_Sender></stringinp></MT_Trg>
    We are using following Java Code for the same.
    import java.io.BufferedReader;
              import java.io.FileInputStream;
              import java.io.FileOutputStream;
              import java.io.InputStream;
              import java.io.InputStreamReader;
              import java.io.OutputStream;
              import java.util.Map;
              import javax.xml.parsers.DocumentBuilder;
              import javax.xml.parsers.DocumentBuilderFactory;
              import javax.xml.transform.Transformer;
              import javax.xml.transform.TransformerFactory;
              import javax.xml.transform.dom.DOMSource;
              import javax.xml.transform.stream.StreamResult;
              import org.w3c.dom.Element;
              import org.w3c.dom.Document;
              import org.w3c.dom.Text;
              import com.sap.aii.mapping.api.*;
              import com.sap.aii.mapping.api.StreamTransformation;
    public class SingleStr implements StreamTransformation{
          * @author user
          * To change the template for this generated type comment go to
          * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
                    public static void main(String args[]) throws Exception {
                FileInputStream inFile =
                 new FileInputStream("C:/Documents and Settings/user.HR0102WILT00033/Desktop/Input.XML");
                FileOutputStream outFile =
                 new FileOutputStream("C:/Documents and Settings/user.HR0102WILT00033/Desktop/Output.XML");
                 SingleStr xml = new SingleStr();
                xml.execute(inFile, outFile);
                System.out.println("Success");
               public void setParameter(Map param) {
                Map map = param;
               public void execute(InputStream in, OutputStream out)
                throws com.sap.aii.mapping.api.StreamTransformationException {
                try {
                 //************************Code To Generate The XML Parsing Objects*****************************//    
                 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                 DocumentBuilder db = dbf.newDocumentBuilder();
                 TransformerFactory tf = TransformerFactory.newInstance();
                 Transformer transform = tf.newTransformer();
                 //Document doc = db.parse(in);
                 Document docout = db.newDocument();
                 Element root = docout.createElement("MT_Trg");
                 root.setAttribute("xmlns:ns","urn:Test_File_to_File");
                 docout.appendChild(root);
                 Element stringinp = docout.createElement("stringinp");
                 root.appendChild(stringinp);
                 BufferedReader inpxml = new BufferedReader(new InputStreamReader(in));
                 StringBuffer buffer = new StringBuffer();
                 String line="";
                 while ((line = inpxml.readLine()) != null)
                 buffer.append(line);
                 String inptxml=buffer.toString();
                 Text srcxml = docout.createTextNode(inptxml);
                 stringinp.appendChild(srcxml);
                 DOMSource domS = new DOMSource(docout);
                 transform.transform((domS), new StreamResult(out));
                 } catch (Exception e) {
                   System.out.print("Problem parsing the file: " + e.getMessage());
                   e.printStackTrace();
    Please help!!

    We are using following Java Code for the same.
    import java.io.BufferedReader;
              import java.io.FileInputStream;
              import java.io.FileOutputStream;
              import java.io.InputStream;
              import java.io.InputStreamReader;
              import java.io.OutputStream;
              import java.util.Map;
              import javax.xml.parsers.DocumentBuilder;
              import javax.xml.parsers.DocumentBuilderFactory;
              import javax.xml.transform.Transformer;
              import javax.xml.transform.TransformerFactory;
              import javax.xml.transform.dom.DOMSource;
              import javax.xml.transform.stream.StreamResult;
              import org.w3c.dom.Element;
              import org.w3c.dom.Document;
              import org.w3c.dom.Text;
              import com.sap.aii.mapping.api.*;
              import com.sap.aii.mapping.api.StreamTransformation;
    public class SingleStr implements StreamTransformation{
               public static void main(String args[]) throws Exception {
                FileInputStream inFile =
                 new FileInputStream("C:/Documents and Settings/user.HR0102WILT00033/Desktop/Input.XML");
                FileOutputStream outFile =
                 new FileOutputStream("C:/Documents and Settings/user.HR0102WILT00033/Desktop/Output.XML");
                 SingleStr xml = new SingleStr();
                xml.execute(inFile, outFile);
                System.out.println("Success");
               public void setParameter(Map param) {
                Map map = param;
               public void execute(InputStream in, OutputStream out)
                throws com.sap.aii.mapping.api.StreamTransformationException {
                try {
                 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                 DocumentBuilder db = dbf.newDocumentBuilder();
                 TransformerFactory tf = TransformerFactory.newInstance();
                 Transformer transform = tf.newTransformer();
                 //Document doc = db.parse(in);
                 Document docout = db.newDocument();
                 Element root = docout.createElement("MT_Trg");
                 root.setAttribute("xmlns:ns","urn:Test_File_to_File");
                 docout.appendChild(root);
                 Element stringinp = docout.createElement("stringinp");
                 root.appendChild(stringinp);
                 BufferedReader inpxml = new BufferedReader(new InputStreamReader(in));
                 StringBuffer buffer = new StringBuffer();
                 String line="";
                 while ((line = inpxml.readLine()) != null)
                 buffer.append(line);
                 String inptxml=buffer.toString();
                 Text srcxml = docout.createTextNode(inptxml);
                 stringinp.appendChild(srcxml);
                 DOMSource domS = new DOMSource(docout);
                 transform.transform((domS), new StreamResult(out));
                 } catch (Exception e) {
                   System.out.print("Problem parsing the file: " + e.getMessage());
                   e.printStackTrace();
    Please help!!

  • Java Mapping with CDATA

    One simplest way is read the data element value as the string and ignore first  six or seven characters by using substring method or so... Use the return value string for parsing the values from respective tag element using parser or manually

    Hi Xinaxu,
    Here is the java mapping code.
    public class Cdata implements StreamTransformation{
         public static void main(String[] args) {
              try{
                   Cdata genFormat=new Cdata();
                   FileInputStream in=new FileInputStream("C:\\Apps\\acm\\cdata.xml");
                   FileOutputStream out=new FileOutputStream("C:\\Apps\\acm\\cdata1.xml");
                   genFormat.execute(in,out);
                   catch(Exception e)
                   e.printStackTrace();
         public void execute(InputStream in, OutputStream out)
                   throws StreamTransformationException {
              try
                   DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
                   DocumentBuilder builderel=factory.newDocumentBuilder();
                   /*input document in form of XML*/
                   Document docIn=builderel.parse(in);
                   /*document after parsing*/
                   Document docOut=builderel.newDocument();
                   TransformerFactory tf=TransformerFactory.newInstance();
                   Transformer transform=tf.newTransformer();
                   Element root,child,child1;
                   root=docOut.createElement("Header");
                   root.setAttribute("xmlns","urn:bp:xi:hr:edm:test:100");
                   NodeList l;
                   Node n;
                   l=docIn.getElementsByTagName("Data");
                   int i,len=l.getLength();
                   String charSet[]={"&lt;","&gt;","&amp;","&apos;","&quot;"};
                   String replaceSet[]={"<",">","&","'","\""};
                   for(i=0;i<len;++i)
                        child=docOut.createElement("Data");
                        if(l.item(i).hasChildNodes())
                             n=l.item(i).getFirstChild();
                             //System.out.println(n.getNodeType());
                             //System.out.println(n.getNodeValue());
                             int j;
                             if(n.getNodeType()==3 && n.getNodeValue().indexOf("CDATA")>=0)
                                  // that means this is Cdata section
                                  //capture data in a string
                                  String s=n.getNodeValue();
                                  /*if you are sure that string contains
                                   * valid xml tags. You can parse
                                   * the tags.First replace
                                   * &lt; with < less than
                                     &gt; with > greater than
                                     &amp; with & ampersand 
                               &apos; with ' apostrophe
                               &quot; with " quotation mark
                               to avoid exceptions
                                  //System.out.println("s="+s);
                                  for(j=0;j<charSet.length;++j)
                                       s=s.replaceAll(charSet[j], replaceSet[j]);
                                  int ll;
                                  ll=s.length();
                                  String a="";
                                  int count=0;
                                  //extract only xml tags from string
                                  for(j=0;j<ll;++j)
                                       if(count<2)
                                            if(s.charAt(j)=='<')
                                                 count++;
                                            if(count<2)
                                                 continue;
                                       a=a+s.charAt(j);
                                  //System.out.println("a="+a);
                                  for(j=a.length()-1,count=0;j>=0;--j)
                                            if(a.charAt(j)=='>')
                                                 count++;
                                            if(count==2)
                                                 break;
                                  if(j>=0)
                                       s=a.substring(0,j+1);
                                  System.out.println(s);
                                  org.xml.sax.InputSource inStream = new org.xml.sax.InputSource();
                                 inStream.setCharacterStream(new java.io.StringReader(s));
                                  DocumentBuilder b=factory.newDocumentBuilder();
                                  Document cdataSection=b.parse(inStream);
                                  child1=(Element) docOut.importNode(cdataSection.getDocumentElement(),true);
                                  child.appendChild(child1);
                             else if(n.getNodeType()==4)
                                  // that means this is Cdata section
                                  //capture data in a string
                                  String s=n.getNodeValue();
                                  /*if you are sure that string contains
                                   * valid xml tags. You can parse
                                   * the tags.  replace invalid characters
                                   * before parsing
                                  for(j=0;j<charSet.length;++j)
                                       s=s.replaceAll(charSet[j], replaceSet[j]);
                                  org.xml.sax.InputSource inStream = new org.xml.sax.InputSource();
                                 inStream.setCharacterStream(new java.io.StringReader(s));
                                  DocumentBuilder b=factory.newDocumentBuilder();
                                  Document cdataSection=b.parse(inStream);
                                  child1=(Element) docOut.importNode(cdataSection.getDocumentElement(),true);
                                  child.appendChild(child1);
                        root.appendChild(child);
                   docOut.appendChild(root);
                   transform.transform(new DOMSource(docOut), new StreamResult(out));
              catch(Exception e)
                   e.printStackTrace();
         public void setParameter(Map arg0) {
              // TODO Auto-generated method stub
    Hope this solves your problem.
    regards
    Anupam

  • Java Mapping with a huge file

    Hi to all,
    I have a strange problem in my integration process.
    there are two java mappings in order to create bapi input:
    -the first mapping keeps a file of 5Mb and transforms it in a file of 50MB (and it works!)
    -the second mapping keeps the file above and has to create another file of 50Mb.
    And this second mapping doesn't work on the customer system, while everything is ok on my developing system.
    On customer system I don't have any error message: SXMB_MONI gives me a "clock" and the message says: mapping in process..... It remains in this status "forever"!!!
    Why does it work on my system with same code and same file and it doesn't on customer's?
    There is any system parameter that I can check to see if there is some difference in system configuration?
    Thank for the help!
    bye,
    Antonio

    Hi Antonio,
    ...seems to be a hardware problem (sizing).
    I would write some logging in my java to see how far it comes.
    Regards Mario

  • Java mapping to validate XML

    Hi
    Im trying to use the code from http://help.sap.com/saphelp_nw04/helpdata/en/c4/e1343e8c7f6329e10000000a114084/frameset.htm to create a java mapping that validates a Xml message from XI, according to xsd resources inside my jar package.
    The problem is that the code explicits the xsd file directory (saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", "./xsd_example/xsd/example.xsd") but my xsd files are inside my jar.
    I tried to use the code above but it worked only if the xsd files dont have any dependencies:
    Object[] schemaSource = new Object[] {
                        SchemaValidator.class.getResourceAsStream(
                             "/file1.xsd"),
                        SchemaValidator.class.getResourceAsStream(
                             "/file2.xsd") };
    docBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource", schemaSource);
    If file1.xsd needs the file2.xsd, an exception saying file2.xsd couldnt be found occurs.
    If the file1.xsd and file2.xsd dont have dependencies, it works sucesfully.
    Anyone knows how to solve it ?
    Thanks

    Hello Danielle,
    Try with this java code :
       import org.apache.xerces.parsers.DOMParser;
    import java.io.File;
    import org.w3c.dom.Document;
    public class SchemaTest
       public static void main (String args[])
              File docFile = new File("document.xml");
              try
                   DOMParser parser = new DOMParser();
                   parser.setFeature("http://xml.org/sax/features/validation", true);
                   parser.setProperty(
                     "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
                                "memory.xsd");
                   ErrorChecker errors = new ErrorChecker();
                   parser.setErrorHandler(errors);
                   parser.parse("document.xml");
             catch (Exception e)
                 System.out.print("Problem parsing the file.");
    Best Regards
    Iván Prieto

  • JAVA Mapping with SAX: Illegal character exception &

    Hi everybody,
    I use a SAX JAVA Mapping. It throws an error cause the xml that is parsed has a
    &amp;
    like in
    <D_3036>Company &amp; Co. KG</D_3036>
    Does anybody know how to solve the problem?
    I do not want to replace the
    &amp;
    Are there special settings/properties for the handler/parser?
    Thanks
    Regards
    Mario

    Hi all,
    thanks for your comments and suggestions. The error was not cause by the problem I describes.
    FYI:
    If there is an ampersand in the middle of a string, than the standard method
    characters
    in the handler is called three times!
    This let me asume the ampersand was the error.
    Regards Mario
    Edited by: Mario Müller on Dec 19, 2008 1:23 AM

  • UME java mapping with ABAP

    Hi Experts
    I need to keep the users of my AS Java syncronized with some user in ERP.
    Thats means, when some user change some information in ABAP, i need to get this information and change in AS Java too, like email or password...
    I can't use CUA, and i can't use that function that syncronized ABAP user in AS Java automatically. There is another way to do it?
    Could somene help me?
    Best Regards
    Marcos Brandã

    Hi Martin
    Thanks for your response,
    When i was talking about the function that syncronized the user in abap and java, i was talking exactly about use ABAP user store as a source for UME. This solution doesn't wirk because the customer do not when activate this. He is worried about the performance and the information of the user in 2 diferent location, there is a lot of users in ABAP user store and he don't want this solution.
    I need to get just specific user to reply in Java stack user store. I kown how can i do it without get user password, but this do not resolve to me. I need the same user credencials in both systems.
    I will see th SPML / Idm and what kind of problems this solution brings to me, if this solve my problem, i will try to use it.
    There is another way, instead this two way? maybe get the encripted password, decript it and save in java user store with encription mecanism of ume?
    Best Regards
    Marcos Brandao

  • Use ProcessBuilder to execute a java program with a file piped as input

    Hi,
    I am trying to execute a java program passing in input file as argument. I have to do this by forking a process and am using Processbuilder.
    I have a main function which calls the executeCliTopologyDesigner method. I get a Java I/O exception
    Caught IOException: Cannot run program "$JAVA_HOME/bin/java oracle.apps.fnd.provisioning.cli.TopologyDesigner ": java.io.IOException: error=2, No such file or directory
    Can you please let me know if I am missing something?
    Thanks,
    pkrish
    Code Snippet:
    private synchronized void executeCliToplogyDesigner(String cliCommand, File tmp)
    throws IOException, InterruptedException
    {    File temp= writeDataInTemp(compDefName);
    cliCommand = "$JAVA_HOME/bin/java oracle.apps.fnd.provisioning.cli.TopologyDesigner ";
    ProcessBuilder pb = new ProcessBuilder(cliCommand,"<",temp.getCanonicalPath());
    executeProcess(pb);
    Edited by: pkrish on Mar 2, 2009 3:56 PM
    Edited by: pkrish on Mar 2, 2009 3:57 PM
    Edited by: pkrish on Mar 2, 2009 3:58 PM
    Edited by: pkrish on Mar 2, 2009 3:59 PM

    Hi,
    I printed out the system environment variables PATH and CLASSPATH and it is as below:
    Classpath :/ade/prprasa_prov_latest/fmwtest/tools/orajtst/home/lib/orajtst.jar:/ade/prprasa_prov_latest/jdev/src/abbot/dist/EXTENSIONS
    Path :/ade/prprasa_prov_latest/fxtn/util/tools/ant/bin:/ade/prprasa_prov_latest/fmwtest/tools/orajtst/home/bin:/ade/prprasa_prov_latest/oracle/jdeveloper/jdev/bin:/ade/prprasa_prov_latest/javahome/jdk/bin:/usr/kerberos/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/usr/local/ade/bin:/OracleProd/oracle10g/bin:/OracleProd/oracle10g/bin:/OracleProd/oracle10g/bin
    The Path does contain java.
    I changed my command as I need a different classpath.
    cliCommand = "/ade/prprasa_prov_latest/javahome/jdk/bin/java -classpath .:/ade/prprasa_prov_latest/oracle/provisioning/tools/lib/*:/ade/prprasa_prov_latest/oracle/provisioning/configframework/lib/*:/ade/prprasa_prov_latest/oracle/provisioning/framework/lib/*"
    Caught IOException: Cannot run program "/ade/prprasa_prov_latest/javahome/jdk/bin/java -classpath .:/ade/prprasa_prov_latest/oracle/provisioning/tools/lib/*:/ade/prprasa_prov_latest/oracle/provisioning/configframework/lib/*:/ade/prprasa_prov_latest/oracle/provisioning/framework/lib/*": java.io.IOException: error=2, No such file or directory
    Any ideas? Please let me know where do I post it if not here.

  • Trouble with a xml array

    I have been working on this issue all morning and need some advice. I have made a 3dCube and each face has 4 boxes fitted in that will display a slideshow of pictures. The trouble is that it skips striaght to the last box leaving the others blank. Bit of a novice here so any help is greatly apreciated, here is my code:
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded1);
    function xmlLoaded1(event:Event):void{
              imgData = new XML(event.target.data);
              imageName = imgData.image[imgNum].imgURL;
              imageWidth = imgData.image[imgNum].imgW;
              imageHeight = imgData.image[imgNum].imgH;
              picLength = imgData.image.imgURL.length();
              for (var i:int = 0;i < picLength; i++){
                        picArray.push (imgData.image.imgURL[i]);
              imageLoader = new Loader;
              imageLoader.load(new URLRequest(imageName));
              var mainReg:URLRequest = new URLRequest(picArray[whoIsOn]);
              imageLoader.load (mainReg);
              imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
              function imageLoaded (evt:Event):void{
                        face1.box1.addChild(imageLoader);
                        TransitionManager.start(face1.box1, {type:PixelDissolve, direction:Transition.IN, duration:2, easing:Strong.easeIn, xSections:50, ySections:10});
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded2);
    function xmlLoaded2(event:Event):void{
              imgData = new XML(event.target.data);
              imageName = imgData.image[imgNum].imgURL;
              imageWidth = imgData.image[imgNum].imgW;
              imageHeight = imgData.image[imgNum].imgH;
              imageLoader = new Loader;
              imageLoader.load(new URLRequest(imageName));
              picLength = imgData.image.imgURL.length();
              for (var i:int = 0;i < picLength; i++){
                        picArray.push (imgData.image.imgURL[i]);
              var mainReg2:URLRequest = new URLRequest(picArray[whoIsOn]);
              imageLoader.load (mainReg2);
              imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded2);
              function imageLoaded2 (evt:Event):void{
                        face1.box2.addChild(imageLoader);
                        TransitionManager.start(face1.box2, {type:PixelDissolve, direction:Transition.IN, duration:2, easing:Strong.easeIn, xSections:50, ySections:10});
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded3);
    function xmlLoaded3(event:Event):void{
              imgData = new XML(event.target.data);
              imageName = imgData.image[imgNum].imgURL;
              imageWidth = imgData.image[imgNum].imgW;
              imageHeight = imgData.image[imgNum].imgH;
              imageLoader = new Loader;
              imageLoader.load(new URLRequest(imageName));
              picLength = imgData.image.imgURL.length();
              for (var i:int = 0;i < picLength; i++){
                        picArray.push (imgData.image.imgURL[i]);
              var mainReg3:URLRequest = new URLRequest(picArray[whoIsOn]);
              imageLoader.load (mainReg3);
              imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded3);
              function imageLoaded3 (evt:Event):void{
                        face1.box3.addChild(imageLoader);
                        TransitionManager.start(face1.box3, {type:PixelDissolve, direction:Transition.IN, duration:2, easing:Strong.easeIn, xSections:50, ySections:10});
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded4);
    function xmlLoaded4(event:Event):void{
              imgData = new XML(event.target.data);
              imageName = imgData.image[imgNum].imgURL;
              imageWidth = imgData.image[imgNum].imgW;
              imageHeight = imgData.image[imgNum].imgH;
              imageLoader = new Loader;
              imageLoader.load(new URLRequest(imageName));
              picLength = imgData.image.imgURL.length();
              for (var i:int = 0;i < picLength; i++){
                        picArray.push (imgData.image.imgURL[i]);
              var mainReg4:URLRequest = new URLRequest(picArray[whoIsOn]);
              imageLoader.load (mainReg4);
              imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded4);
              function imageLoaded4 (evt:Event):void{
                        face1.box4.addChild(imageLoader);
                        TransitionManager.start(face1.box4, {type:PixelDissolve, direction:Transition.IN, duration:2, easing:Strong.easeIn, xSections:50, ySections:10});

    use the trace() function to pinpoint the error.

  • How to pass input parameter (parameterized mapping) to java mapping program

    Hello
    I have a question about the parameterized mapping with Java (PI 7.1).
    In the operation mapping (using Java-class) I defined a inputer parameter (string). I think I am supposed to retrieved the value using:
                    arg0.getInputParameters().getString("myInputParameterName");
    where arg0 is the TransformationInput object.
    However I am not able to get the value, I got runtime exception saying the inputer parameter doesn't exit.
    Then I figured out maybe I need to bind the OM input parameter to Java mapping parameter, just like in case of message mapping, you need to bind OM parameter to MM parameter. However there is no way to define input parameter for the java mapping program.
    Anybody has done java mapping with parameterized mapping?
    Anybody can give any hint for this?
    Thanks
    Jayson

    InputParameters params = container.getInputParameters();
    DynamicConfiguration conf = (DynamicConfiguration) params.getValue(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Directory");
    http://help.sap.com/saphelp_nwpi71/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
    Edited by: Anand on Dec 10, 2008 4:13 PM

  • Creation of additional attachment in Java Mapping

    Hello all,
    I want to use a Java Mapping with the functionality to create a second /attachment which I can send over email out?
    I don’t want to pick this file somewhere from the server, instead I want to fill the content of the additional attachment directly in the java mapping.
    I hope somebody knows the answer of my question.
    If its possible is there any kind of example??
    Many thanks for your help
    ilka

    hi Stefan,
    http://scn.sap.com/thread/1874962
    Regarding the comment in this thread, can you please tell me if you have faced any issue with creating output attachments. Right now, i have a message mapping in which i have written a udf to create attachments
    this message mapping is a multi mapping and the source is 0-unb. I have used a return as xml on the root message and pointed it to the udf after split by value.
    There are three root nodes in one of my cases, and when this goes through this mapping, there is 1 attachemnt each created with three main documents and submain documents. However, all the attachments contain details of the first root node itself where in actually it should be each main and submain document having a different attachment. Please find my udf below. Please let me know if you think it is wrong somewhere.
    udf :-
    GlobalContainer globalContainer = container.getGlobalContainer();
    OutputAttachments outputAttachments = globalContainer.getOutputAttachments() ;
    int flag =0;
    AbstractTrace trace = container.getTrace();
    String attachmentName = "";
    //for(int i=0;i<var1.length;i++){
    try
    var1=var1.replaceAll("><",">\n<");
    attachmentName = "attachment"+cnt;
    Attachment newopAttachment = outputAttachments.create((attachmentName), var1.getBytes("UTF-8"));
    outputAttachments.setAttachment(newopAttachment);
    trace.addInfo("newopAttachment"+newopAttachment);
    cnt=cnt+1;
    attachmentName ="";
    newopAttachment = null;
    var1="";
    catch (Exception e)
    trace.addInfo("ever reaching trace");
          e.printStackTrace(); 
    //result.addValue("1");  
    //result.addValue("1");  
    return "1";
    Input :-
    Messages
    Message1
    SBDH
    SBDH
    SBDH
    Each of the above SBDH, i have returned as xml and pointed to the udf after split by value
    Your help is highly appreciated.
    Regards,
    Ninu

  • XSLT & JAVA Mapping issue.

    is there any situation,
    where we should definately go for XSLT mapping..
    where we should definately go for JAVA mapping..
    can anyone brief me plz....
    Cheers,
    Raghavesh

    No hard and fast rules.
    There never can be specific rules.
    1. Java Mapping should be used when the input is NON XML for sure. As the input is a InputSTream, you can convert it to a string and do the needful programmic logic etc.
    2. XSL can be used with HTML source etc.
    Regards
    Bhavesh

  • N:1 Mapping Possible using Java Mapping?

    All,
    Is it possible to do a N:1 mapping using Java Mapping?
    If yes , how?
    Reason for this question is that the execute() of the Java Mapping is going to take the source / request message as the InputStream . In the case of N:1 mapping , as we have multiple messages , how will they be send to the InputStream? Will both the messages be sent combined into the InputStream? Will the MESSAGES tag be embedded into the input stream?
    Regards,
    Bhavesh

    Hi @ll;
    i try the same.
    to conduct a java mapping with 2 input structures that fills one target structure.
    This mapping is part of a Integrationprocess.
    I tested the mapping at the Integration Repository (Interface mapping) with the structure given by henrique and it works fine without any error.
    At runtime this structure looks like this (different prefix)
    <?xml version="1.0" encoding="UTF-8"?>
    <sxi:Messages xmlns:sxi="http://sap.com/xi/XI/SplitAndMerge">
         <sxi:Message1>
              <YOURXML1>...</YOURXML1>
         </sxi:Message1>
         <sxi:Message2>
              <YOURXML2>...</YOURXML2>
         </sxi:Message2>
    </sxi:Messages>
    As I put it in the Integrationprocess unfortunately a strange error arises.
    The trace Workflow-Protocoll shows following error.
    <Trace level="2" type="T">Call method execute of the application Java mapping com.endress.infoserve.xi.mapping.MergeConfigStore_IdocOrder </Trace>
    <Trace level="2" type="T">Java mapping com/endress/infoserve/xi/mapping/MergeConfigStore_IdocOrder completed. (executeStep() of com.endress.infoserve.xi.mapping.MergeConfigStore_IdocOrder </Trace>
    <Trace level="1" type="T">Parsing error after multi mapping.Expected Message<i> instead of IDOC </Trace>
    I can't make head nor tail of it.
    what´s the mistake?
    can anybody please help me?
    Thanks in advance
    Kind regards

Maybe you are looking for

  • How to pass the values to the WHERE-Clause in JClient ADF?

    Hi all, my JDeveloper Version is 10.1.2.0.0 (Build 1811) I need something like this: A Form with a Filter-Panel, and the Table-Panel EMP. In Filter: 1. DEPTNO as ComboBox with values from the DEPT table (not static values). The ComboBox should contai

  • Loading external movies differently

    I am making a web site with several pages that the content will load as an external movie. Right now I have all loading with the nav buttons "on release". The first page loads through one blank clip and the rest in another. What I would like to do is

  • When I watch my tv shows in itunes, the people's voice is out of sync with the picture.  any suggestions???

    When I watch my tv shows on my mac computer thru itunes, the voice is out of sync with the picture.  any suggestions???

  • Dual HDMI

    Can a Mac min 2012 support dual hdmi outputs via onboard HDMI port and mini display to HDMI adapter simultaneously in video mirroring or extended desktop mode?

  • CUCM 9.1 SIP Error 503

    Dear Community Members I have CUCM 9.1 and 3rdparty IP GSM gateway which is connected to CUCM via SIP Trunk. When I try to make a call through it the trace show me error 503 on CUCM, but, the GSM Gateway does not show any activity about this call. Wh