How to get the whole payload

Hey guys,
I have a requirement where I need to call a stored procedure through a JDBC adapter. The particularity in this call is that I need to send the complete source XML payload as a string in just one element and not mapping each element with input variables of the store procedure.
I need to know if there is a way to get the incoming XML payload as one big String within XI.
Any inputs will be helpful !!!
Cheers,
Mauricio

Hi,
When you write a JAVA Mapping , you need to implement the StreamTransfromationClass which implements execute and setParameter methods.
In the execute method , you get the Source XML as an InputStream and the need to push the Output XML as the output stream.
You can use a DOM or SAX parser to prase the XML source and create the target XML.
To get the entire Source into s String, use this code,
BufferedReader in = new BufferedReader(new InputStreamReader(inp));
StringBuffer buffer = new StringBuffer();
String line="";
while ((line = in.readLine()) != null) {
buffer.append(line);
String sourcexml=buffer.toString();
Take a look at thise blog for Java Mapping,
/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
Regards,
Bhavesh

Similar Messages

  • How to get the XML Payload of called process from calling process?

    I have two SOA processes say process A and process B.
    Process B is called by process A.In process A I, am using the getRequestMessage() method in Java code to get the XML payload of process A.
    But i want the XML payload of process B in process A.How can i achieve it?

    Doug,
              I used the property loader method but I could not load the limits of any sub sequence call calling an external sequence file.
    I took the FlowRate_test.seq example from the NI Example folder "C:\Documents and Settings\All Users\Documents\National Instruments\TestStand 4.2.1\Examples\PropertyLoader\LoadingLimits\LimitsFromExcelFile\UsingCVI". I created a sequence called PumpTest.seq in the same folder path. I then moved the Pump Test step from the FlowRate_test.seq to the PumpTest.seq. Now created a sequence call in the FlowRate_test.seq and called the PumpTest.Seq as the module path. When I execute the FlowRate_test.seq , I get the error as shown below:
    Attached is the Flowrate_Test.seq and the PumpTest.seq which should be there in the folder path "C:\Documents and Settings\All Users\Documents\National Instruments\TestStand 4.2.1\Examples\PropertyLoader\LoadingLimits\LimitsFromExcelFile\UsingCVI".
    Let me know whether I am doing something wrong in this method. 
    My idea is to alter the runstate variable High and Low of Pump Test in the PumpTest.seq and then run the Flowrate_Test.seq.
    Attachments:
    PumpTest.seq ‏6 KB
    FlowRate_test.seq ‏11 KB

  • How to get the input payload passed to the BPEL Process using java.

    Hi all,
    I am working on an application in which, if some fault occurs in the flow I need to insert the input payload that is being sent to the BPEL process into a Queue using Java. I have gone through the FaultHandling framework and failed to find the method by which we can get the input payload. Can someone kindly help me in getting the input payload. using the java.
    Regards

    Hi,
    Use method getVariableData with your input variable.
    Object getVariableData(String name, String part, String query)
    For example: getVariableData("input", "payload", "/");
    http://docs.oracle.com/cd/E17904_01/integration.1111/e10224/bp_java.htm
    Cheers,
    Vlad

  • How to get the whole map image after zoom in?

    Hi,
    I use mapviewer API to generate map images and put them in JSP as well as in Java Applet. I called the method getGeneratedImage(). After I using the methods zoomIn() or zoomOut(), I got a new map image. But the size is fixed, so after zoom in I can only see a part of the whole map. I would like to use scrollbar to see other part of the map after zoom in.
    How can I solve this problem? I have the images as predefinied themes saved in database with MBR information.
    Thanks in advance.

    Hi,
    For the map request in MapViewer you may define the data area that you want to display, as well as the device size (width and height). The result is a java Image with width and height sizes. You can draw this image on a canvas with scroll bars, and if the size of the canvas is smaller than the image size, then you should see the scroll bars. But you have to code that. MapViewer will just return an Image with the specified size.
    The zoom in/out options just change the data area, but keeps the device size. Therefore you should use the API methods to set the data area (setBox or setCenterAndSize) and to set the device size (setDeviceSize), in order to control the size of your resulted image, and then draw it on your canvas with scroll bars.
    Regards.

  • How to get the whole list of Iview Templates

    Hi,
    when I navigate:
    Portal Content -> Content Provided by SAP -> Templates -> Iview Templates
    I get a long list of templates including Url Iviews etc
    But, when I try to create my own Iview, the list of potential templates is much smaller, mainly including only the SAP related templates, BSP, Query, ITS etc.
    Does anyone know how to make the full list of Iview Templates available for the Iview creation wizard ?
    Thanks,
    Tomas.

    Hi Tomas,
    which iView templates are offerd within the iView creation wizard is determined by SystemAdmin -- Permissions -- Portal Permissions -- Applications.
    Normally, you will have to have SuperAdminRole to see/change these settings.
    Hope it helps
    Detlev
    PS: Please consider to reward points for helpful answers. Thanks in advance!

  • How to get the WHOLE xml document inside a string using XSLT mapping

    Hi folks,
    I have a deep xml structure that I want to embed as body, tags included, in a mail message (not as an attachment).
    I'm trying to use Michal's method in this blog
    /people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
    However, I can't get it to deliver the entire structure instead of just specific elements.
    Any help is greatly appreciated,
    Thanks,
    Guy

    Ashok,
    I was able to work it out for my case.
    This XSL......
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <inside>
    <namestring>
    <xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text>
    <xsl:copy-of select="outside/name/*"/>
    <xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text>
    <xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
    </namestring>
    </inside>
    </xsl:template>
    </xsl:stylesheet>
    ...will transform this input....
    <?xml version="1.0" encoding="UTF-8"?>
    <outside>
    <name>
    <nameone>name1</nameone>
    <nametwo>name2</nametwo>
    <namethree>name3</namethree>
    </name>
    </outside>
    ...and put the whole lot into the CDATA element.
    Hope this helps you,
    Guy

  • How to get the whole timestamp from a postgresql database

    Hello,
    Has anyone an idea on how I can get the timestamp from a PostgreSQL database with the fractional seconds information ? I'm using the database connectivity toolkit
    Thanks
    Salim

    and there was even an easier solution
    Why doing simple things when you can struggle for hours

  • How to get the whole attachment as a MimeMessage?

    I'm finding a way to deal with base64 encoded .eml attachment. I need to parse it to MimeMessage for further process
       for (i=0; i<part.getCount(); i++) {
            currentPart = (MimePart) part.getBodyPart(i);
            if ( file extension is .eml ) {
                InputStream input = currentPart.getInputStream();
                currentPart = new MimeMessage(null, input);
            }with the above code, I would only get the decoded body of the email content, all header information are missing.
    From JavaMail API, getInputStream() and writeTo() would only get/write the content part, so I've tried to use:
       for(Enumeration enum = currentPart.getAllHeaderLines(); enum.hasMoreElements();)     {
            currentPart.addHeaderLine((String)enum.nextElement());
       }          I suppose currentPart is a MimeMessage now, but when I try this:
       request.setAttribute("part", (MimeMessage) currentPart.getContent());I would get a ClassCastException
    Would anyone give me some suggestion?

    I am a little unsure as to what exactly you are trying to achieve, but I will assume you are trying to extract the attachment from one message and parse this attachment as a MimeMessage.
    First, the parts in a MimeMessage are grouped in a tree structure so you can't just iterate over the list of parts and expect to get them all, you have to do it recursively.
    eg., (pseudo code only)
    public void getParts(Part p, List parts) {
      if(p.getContent() != null) {
        if(p.getContent() instanceof Multipart) {
          Multipart mp = (Multipart) content;
          for(int i = 0; i < mp.getCount(); i++) {
            getParts(mp.getBodyPart(i), parts);
        else
           parts.add(p);
    // Then call it like:
    List parts = new LinkedList();
    getParts(part, parts);
    // Where "part" is your original messageOnce you have the list of parts, you need to find the attachment. This is done by looking at the "disposition" of the part.
    An attachment will usually (although not always) be of type MimeMessage.INLINE or MimeMessage.ATTACHMENT
    So... iterate though your parts list looking for attachments
    Iterator i = parts.iterator();
    Part p = null;
    MimeMessage attachment = null;
    while(i.hasNext()) {
      p = (Part)i.next();
      // NOTE: p.getDisposition() may be null here
      if(p.getDisposition().equals(MimeMessage.INLINE) || p.getDisposition().equals(MimeMessage.ATTACHMENT)) {
        // You have an attachment
        // Use the data handler to get the stream
        InputStream input= p.getDataHandler().getInputStream();
        // Construct you new MimeMessage
        attachment = new MimeMessage(null, input);
        // Exit the loop
        break;
    }The simplest way to test is you have your attachment is to print it's filename with p.getFileName();
    You can also bypass creating the part list by adding the disposition check to the first getParts method.

  • After paying for a song, the whole song did NOT download.  How to get the whole song?

    I bought the songs, downloaded them, synced them to my iPod, then clicked play. Two of the new songs stopped playing at around the 50 second mark. So, I played them again to check to make sure I didn't just fast forward... Same thing happened again. I decided to go back onto my computer to redownload it, if the songs just didn't get to download fully, and iTunes didn't let me download it again.
    I have no idea what to do to finally get to listen to the full songs! Can someone help me out?!?

    I decided to go back onto my computer to redownload it, if the songs just didn't get to download fully, and iTunes didn't let me download it again.
    Doublechecking. Did you delete the two songs (and their associated files) from your iTunes library prior to attempting the redownload?

  • I recently managed to get the whole casing of my 13" Macbook Pro (Mid-2009) replaced due to a missing foot and dodgy spacebar. The lid is dented and scratched so would like to know how much it would cost to replace? I know its not covered by AppleCare.

    So i took my Macbook Pro 13'' (Mid-2009) into Apple because the spacebar was jammed and I had one of the feet of the bottom casing missing which was unusual (black circles). The unibody and bottom plate had a fair few dents and nicks and under AppleCare I was able to get the whole unibody and bottom case fixed for free. Saved myself a good £181!
    This now leaves my lid which has one or two noticeable dents and the bottom right part is suffering from several scratches. I was wondering how much a new lid would cost if I took it into Apple? I know it won't be covered under AppleCare as its accidental damage but want to know whether its worth paying for to have a once again dent free Macbook Pro .
    As a side note, do Apple upgrade your hardware at all, such as the hard drive or memory? I know it would be cheaper to do it at an independant computer shop or by myself but would like to explore my options first.

    http://www.ifixit.com/
    See my reply to your second question elsewhere.

  • How to get the value of payload?

    Hi
    The null is returned when I use the following code to get the User_ID element in the payload, but there are values in the User_ID element of the payload
    Task task_test = wfSvcClient.getTaskQueryService().getTaskDetailsById(wfCtx, taskId);
    System.out.println("the payload value is " + task_test.getPayloadAsElement().getElementsByTagName("User_ID").item(0).getNodeValue());
    How to get the node value of payload ? any suggestion?
    Thanks
    Jayson

    Hi Jayson,
    Try:
    System.out.println("the payload value is " + task_test.getPayloadAsElement().getElementsByTagName("User_ID").item(0).getFirstChild().getNodeValue());
    So add the getFirstChild() call in between.
    If this works, maybe consider using JAXB to marshall the payload details to POJO's. This will make reading the payload details much easier.
    Regards, Ronald

  • When I attach a PDF document in mail only the first page appears. How do I get the whole document to work

    Title says it all. I go to attach file add the fild and the first page shows up in the body of the email. How do I get the whole document to show up?

    You can't get the whole document to appear on your side.
    When you send it, the entire document will be sent.  Normally, clicking on it will open it in preview where you can see all pages.  If you want to see it in this way, just cc: or bcc: yourself on the email when you send it.

  • How to get the node value of payload

    Hi
    The null is returned when I use the following code to get the User_ID element in the payload, but there are values in the User_ID element of the payload
    Task task_test = wfSvcClient.getTaskQueryService().getTaskDetailsById(wfCtx, taskId);
    System.out.println("the payload value is " + task_test.getPayloadAsElement().getElementsByTagName("User_ID").item(0).getNodeValue());
    How to get the node value of payload ? any suggestion?
    Thanks
    Jayson

    Hi Jayson,
    Try:
    System.out.println("the payload value is " + task_test.getPayloadAsElement().getElementsByTagName("User_ID").item(0).getFirstChild().getNodeValue());
    So add the getFirstChild() call in between.
    If this works, maybe consider using JAXB to marshall the payload details to POJO's. This will make reading the payload details much easier.
    Regards, Ronald

  • Recently downloaded a whole cd on itunes. However, as it was downloading one of the songs was interrupted and didn't fully download. How do i get the whole song without having to pay again?

    I recently downloaded a whole cd on itunes. However, as it was downloading one of the songs was interrupted and didn't fully download. How do i get the whole song without having to pay again?

    Depending upon what country that you are in (music can't be re-downloaded in all countries) then try deleting the incomplete track from your iTunes library and redownload it via the Purchased link under Quick Links on the right-hand side of the iTunes store home page on your computer's iTunes.
    If you aren't in a country where you can re-download music then you will need to contact iTunes Support - try the 'report a problem' link from your purchase history : log into your account on your computer's iTunes via the Store > View Account menu option and you should then see a Purchase History section with a 'see all' link to the right of it ; click on that and you should see a list of your purchases ; find that song and use the 'Report a Problem' link and fill in details about the problem (iTunes support should reply within, I think, about 24 hours).
    If the 'report a problem' link doesn't work (it's been taking some people to this site on a browser instead of showing a form in iTunes) then you can try contacting iTunes support via this page : http://www.apple.com/support/itunes/contact/- click on Contact iTunes Store Support on the right-hand side of the page.

  • I recently downloaded a whole cd on itunes. However, as it was downloading one of the songs was interrupted and didn't fully download. How do i get the whole song without having to pay again?

    I recently downloaded a whole cd on itunes. However, as it was downloading one of the songs was interrupted and didn't fully download. How do i get the whole song without having to pay again?

    Go to iTunes Store > Purchased ( in Quick Links on the right) and redownload

Maybe you are looking for