Creating XML string to be pushed into a JMS queue

Hello All
I am trying to pass the following XML string into a sender obj, however, I am not sure how it is supposed to be done, with the right escape sequencing.
message.setText("<rawData><Name="Mike"></Name><Value="200"></rawData>");
Please guide me.
Thanks,
AJ

Login User should have the Admin privilege, Otherwise it is not possible to post data manually into the JMS Queue.
Log into weblogic Console > click on JMS Module > <select the JMSModule where the Queue resides : e.g SOAJMSModule> >Select the Queue > Monitoring > Check the Box > click on "Show Message" > New > Post the data in "Body" section.
Or, you can create another BS in OSB, pointing to that JMS Queue(using Input.xsd) . then execute the BS using your Input.xml

Similar Messages

  • How to create XML string for an object matching the result of a marshal?

    I'm trying to create a XML string representation of an object which exactly matches the XML which results from marshalling the object into a request. I'm almost there except that the XML string I come up with is missing the attribute "standalone=\"yes\"" in the topmost xml element, and this attribute is present in the marshalled XML. I'm using the XML string to create a payload signature which must match exactly with the XML payload of the request, so the two XML representations of the object really do need to be identical.
    Here's what I'm doing to create the XML from the object:
       private String myObjectToXmlString (final MyObject myObject)
           throws Exception {
                 try {
               DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
               Document document = documentBuilder.newDocument();
               myObjectMarshaller.marshal(myObject, document);
               Source source = new DOMSource(document);
               StringWriter stringWriter = new StringWriter();
               Result result = new StreamResult(stringWriter);
               TransformerFactory factory = TransformerFactory.newInstance();
               Transformer transformer = factory.newTransformer();
               transformer.transform(source, result);
               return stringWriter.getBuffer().toString();
           } catch (Exception ex) {
               throw new Exception("Unable to convert a MyObject object to an XML String -- " + ex.toString(), ex);
       }The XML which is produced looks like this:
    <?xml version=\"1.0\" encoding=\"UTF-8\"?>
    <ns2:myObject xmlns:ns2=\"http://sunconnection.sun.com/xml\">
       <myObjectId>0</myObjectId>
       <objectType>1</objectType>
       <description>Test Object</description>
    </ns2:myObject>The payload object is marshalled to the request like so:
        // marshall the MyObject to the output stream
       OutputStream outputStream = myHttpUrlConnection.getOutputStream();
       myObjectMarshaller.marshal(myObject, outputStream);
       outputStream.flush();
       outputStream.close();When I view the XML payload of the request it looks like this:
    <?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>
    <ns2:myObject xmlns:ns2=\"http://sunconnection.sun.com/xml\">
       <myObjectId>0</myObjectId>
       <objectType>1</objectType>
       <description>Test Object</description>
    </ns2:myObject>As you can see the two XML representations of the object are identical except for the standalone attribute in the xml element.
    It'd be a hack to make the assumption that the standalone attribute will always be there in the marshalled object and to just hard code it into the XML string returned by my object to XML method. Since I'm using the same Marshaller to create the XML string as I am to perform the marshalling to the request I assume that there's some way to make it give the same XML in both cases, and that I'm doing something wrong in my method which converts the object to an XML string. If anyone can see where I'm going wrong in that method (myObjectToXmlString() above), or can suggest a better way of doing this, then I'll certainly appreciate the insight.
    --James                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    It turns out that I was taking the wrong approach in my object to XML string method. A cleaner/better way to do it, which gives the correct result, is this:
        private String myObjectToXmlString (final MyObject myObject)
            throws Exception {
            try {
                ByteArrayOutputStream stream = new ByteArrayOutputStream();
                myObjectMarshaller.marshal(myObject, stream);
                return stream.toString();
            } catch (Exception ex) {
                throw new Exception("Unable to convert a MyObject object to an XML String -- " + ex.toString(), ex);
        }--James                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to create XML string from BPM Business Object?

    Hello,
    I have a business object in my BPM project and I need to transform it in a XML string:
    From:
    Business Object: Customer
    Properties:          Name, Age
    To:
    "<Customer><Name>Robert</Name><Age>17</Age></Customer>"
    How can I do this?
    Thanks.

    Hello,
    I have a business object in my BPM project and I need to transform it in a XML string:
    From:
    Business Object: Customer
    Properties:          Name, Age
    To:
    "<Customer><Name>Robert</Name><Age>17</Age></Customer>"
    How can I do this?
    Thanks.

  • Creating XML String DOM

    Hi ppl,
    I need some help with DOM Object. I have a xml file which I parse with dom and when I do some changes in dom object like adding new element or changing the values of existing object and now when I try to transorm the dom object back to a xml string. It puts everything in one line. for example say my xml file is like:-
    <student>
        <name>john</name>
        <result>pass</result>
    </student>Now when I add new element <address> to it , change value of existing element and try to get xml string i get something like this
    <student><name>smith</name><address>412Miam</address><result>pass</result></student>
    Whole xml in one or two lines, instead of proper xml with one element and its value in one line.
    Any ideas how to achieve this?

    Ddosot,
    Thank you very much. I was looking for this from long time.
    Honeslty I have searched news group many times but couldnt get an answer, may be my search words were not correct.
    you could have saved all this writing by running a
    little search on this forum, as this questions is
    asked once per day.
    anyway, here is your answer:
    transformer.setOutputProperty(OutputKeys.INDENT,
    "yes");
    transformer.setOutputProperty("{http://xml.apache.org/x
    lt}indent-amount", "1");

  • Oracle PL/SQL procedure/function to post message into weblogic jms queue

    Hi All,
    Is it possible to post messages to weblogic JMS queue from pl/sql procedure/function?
    From this Queue, message will be read by OSB interface.
    Any help will be highly appreciated.
    Regards,
    Steve

    904640 wrote:
    Hi All,
    Is it possible to post messages to weblogic JMS queue from pl/sql procedure/function?
    From this Queue, message will be read by OSB interface.
    Any help will be highly appreciated.
    http://www.lmgtfy.com/?q=oracle+pl/sql+weblogic+jms+queue

  • Oracle PL/SQL procedure to post message into weblogic jms queue

    Hi All,
    Is it possible to post messages to weblogic JMS queue from pl/sql procedure/function?
    From this Queue, message will be read by OSB interface.
    Any help will be highly appreciated.
    Regards,
    Steve

    904640 wrote:
    Hi All,
    Is it possible to post messages to weblogic JMS queue from pl/sql procedure/function?
    From this Queue, message will be read by OSB interface.
    Any help will be highly appreciated.
    http://www.lmgtfy.com/?q=oracle+pl/sql+weblogic+jms+queue

  • How to get an xml string into a Document w/o escaping mark-up characters?

    Hi,
    I am using one of the latest xerces using Java. I am pretty sure I am using xerces-2.
    I have an existing Document and I am trying to add more content to it. The new content itself is xml string. I am trying to insert this xml string into the document using document.createTextNode. I am able to insert, but somewhere it is escaping the mark-up characters (<,>,etc). When I convert the document into String, I can see, for example, <userData> instead of <userData>.
    There is an alternative option to accomplish this by creating a new document with this xml string, get the root element, import this element into my document. Execution time for this procedure is very high - means, this is very bad in terms of time-wise performance.
    Can any help on how to accomplish this (bringing an xml string into a document without escaping mark-up characters) in time-efficient way.

    So you want to treat the contents of the string as XML rather than as text? Then you have to parse it.
    Or if your reason for asking is just that you don't like the look of escaped text, then use a CDATA section to contain the text.

  • Inserting XML String into Table with help of Stored Proc

    I will be getting XML String from JAVA, which I have to insert in Table A, XML String is as follows
    <?xml version = '1.0'?>
    < TableA>
    <mappings Record="3">
    < MESSAGEID >1</ MESSAGEID >
    < MESSAGE >This  is available at your address!</ MESSAGE>
    </mappings>
    <mappings Record="3">
    < MESSAGEID >2</ MESSAGEID>
    < MESSAGE >This isn’t available at your address. </ MESSAGE>
    </mappings>
    </ TableA >
    Table Structure*
    MESSAGEID     VARCHAR2(15 BYTE)
    MESSAGE     VARCHAR2(500 BYTE)
    This is the stored procedure which I have written to insert data into TableA, V_MESSAGE will be input parameter for inserting XML String 
    create or replace procedure   AP_DBI_PS_MESSAGE_INSERT
    V_MESSAGE VARCHAR2(1024)
    AS
    declare
    charString varchar2(80);
    finalStr varchar2(4000) := null;
    rowsp integer;
    V_FILEHANDLE UTL_FILE.FILE_TYPE;
    begin
    -- the name of the table as specified in our DTD
    xmlgen.setRowsetTag('TableA');
    -- the name of the data set as specified in our DTD
    xmlgen.setRowTag('mappings');
    -- for getting the output on the screen
    dbms_output.enable(1000000);
    -- open the XML document in read only mode
    v_FileHandle := utl_file.fopen(V_MESSAGE);
    --v_FileHandle := V_MESSAGE;
    loop
    BEGIN
    utl_file.get_line(v_FileHandle, charString);
    exception
    when no_data_found then
    utl_file.fclose(v_FileHandle);
    exit;
    END;
    dbms_output.put_line(charString);
    if finalStr is not null then
    finalStr := finalStr || charString;
    else
    finalStr := charString;
    end if;
    end loop;
    -- for inserting the XML data into the table
    rowsp := xmlgen.insertXML('ONE.TableA',finalStr);
    dbms_output.put_line('INSERT DONE '||TO_CHAR(rowsp));
    xmlgen.resetOptions;
    end;Please Help
    Edited by: 846857 on Jul 18, 2011 10:55 PM

    with t as (select xmltype('<TableA >
                               <mappings Record="3">
                               <MessageId>1</MessageId>
                               <Message> This bundle is available at your address!</Message>
                               </mappings>
                               <mappings Record="3">
                               <MessageId>2</MessageId>
                               <Message>This isn’t available at your address. </Message>
                               </mappings>
                               </TableA  >') col FROM dual)
      --End Of sample data creation with subquery factoring.
      --You can use the query from here with your table and column name.
    select EXTRACTVALUE(X1.column_value,'/mappings/MessageId') MESSAGEID
          ,EXTRACTVALUE(X1.column_value,'/mappings/Message') MESSAGE
    from t,table(XMLSEQUENCE(extract(t.COL,'/TableA/mappings'))) X1;Above Code works as i get result
    MESSAGEID     MESSAGE
    1             This bundle is available at your address!
    2             This isn’t available at your address.
    _____________________________________________ now I want to insert the result into Table A... How to proceed... Please help
    Edited by: 846857 on Jul 19, 2011 12:15 AM

  • Getting Error while creating Document object  after  parsing XML String

    Hi All,
    I have been trying to parse an XML string using the StringReader and InputSource interface but when I am trying to create Document Object using Parse() method getting error like
    [Fatal Error] :2:6: The processing instruction target matching "[xX][mM][lL]" is not allowed.
    seorg.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
    Please find the code below which i have been experimenting with:
    import java.io.BufferedReader;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.StringReader;
    import java.util.List;
    import java.util.*;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import java.io.*;
    public class TestMain {
         public static void main(String[] args) {
              String file = "";
              file = loadFileContent("C:\\Test.xml");
              System.out.println("contents >> "+file);
              parseQuickLinksFileContent(file);
    public static void parseQuickLinksFileContent(String fileContents) {
    PWMQuickLinksModelVO objPWMQuickLinksModelVO = new PWMQuickLinksModelVO();
         try {
    DocumentBuilderFactory factory =           DocumentBuilderFactory.newInstance();
         DocumentBuilder builder = factory.newDocumentBuilder();
         StringReader objRd = new StringReader(fileContents);
         InputSource objIs = new InputSource(objRd);
         Document document = builder.parse(objIs); // HERE I am getting Error.
         System.out.println(document.toString());
    What is happening while I am using builder.parse() method ???
    Thanks,
    Rajendra.

    Getting following error
    [Fatal Error] :2:6: The processing instruction target matching "[xX][mM][lL]" is not allowed.
    seorg.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.

  • Parsing an xml string into id-value pair format

    Hi,
    I am new in oracle BPEL.
    My requirement is that I need to parse an xml string containing tag name and coressponding value into an 'id -value' pair.
    For example-
    The input xml format is -
    <employee>
    <empid>12345</empid>
    <name>xyz</name>
    <city>London</city>
    </employee>
    The required xml format is-
    <employee>
    <item id="empid" value="12345"/>
    <item id="name" value="xyz"/>
    <item id="city" value="London"/>
    </employee>
    Please let me know if there is a work-around for this.
    Thanks

    Something like this (have not tested):
    <xsl:for-each select="//employee">
    <employee>
    <xsl:for-each select="./*">
    <item>
    <xsl:attribute name="id">
    <xsl:value-of select="name()"/>
    </xsl:attribute>
    <xsl:attribute name="value">
    <xsl:value-of select="text()"/>
    </xsl:attribute>
    </item>
    </xsl:for-each>
    </employee>
    </xsl:for-each>

  • Help: How to parse XML string into Node Context

    Hi Experts,
    I am trying to work with a web dynpro for java application which calls a Web Service. I can call the web service successfully, however I have a problem on interpreting the response result into table. The response result is in (XML) string format, like this:
    I followed this , but it resulted to an error:
    com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Name expected: 0x20(:main:, row:158, col:59)(:main:, row=158, col=59) -> com.sap.engine.lib.xml.parser.ParserException: Name expected: 0x20(:main:, row:158, col:59)
    do anyone of you had a similar experience and were able to resolve it, please post it here. it will be highly appreciated. thanks in advance.

    Try this :
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    Document doc = db.parse(new org.xml.sax.InputSource(new StringReader(strXml)));Hope this helps.

  • Convert XML string into XML

    Hi All,
    Can you please let me know for any sample code in xslt/java mapping for converting XML string into XML. We use SAP Pi 7.0
    My XML string starts like this
    <?xml version="1.0" encoding="UTF-8" ?> 
    - <ns0:MT_ReceiverFileStructure <namespace>"><Output><?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<xsl>"?><Tarih_Date Tarih="11.09.2014" Date="09/11/2014>
       Thanks,
       Pavithra

    Thanks Praveen. It worked.
    However, the xml i have is an extract from a exchange rate URL and it has the reference to a xsl in it as below
    <?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<ABC.xsl>"?>.
    So there is an error in sxmb_moni. Is it possible to remove this.

  • A class to format an XML string into indented xml code

    I am looking for a class or a piece of code to format an XML string into indented xml code
    for example: an XML string as follows
    <servlet><servlet-name>Login</servlet-name>servlet-class>ucs.merch.client.system.LoginServlet</servlet-class></servlet><servlet-mapping><servlet-name>Login</servlet-name>
    to format into :
    <servlet>
    <servlet-name>Login</servlet-name>
    <servlet-class>ucs.merch.client.system.LoginServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Login</servlet-name>
    <url-pattern>/Login</url-pattern>
    </servlet-mapping>
    e-mail : [email protected]

    Xerces has a class called OutputFormat
    If you have your XML document in memory, you can format it using the method setIndenting(true) on the OutputFormat class. The following is an example:
    assuming xmlDoc is our document and fileName is the name of the file we wish to write to:
    OutputFormat format = new OutputFormat(xmlDoc);
    // setup output file name
    PrintWriter printwriter = new PrintWriter(new FileWriter(fileName, false));
    // construct an XMLSerializer for writing the document
    XMLSerializer serializer = new XMLSerializer( printwriter, format );
    // Ensure output is indented correctly...
    format.setIndenting(true);
    // set serializer as a DOM Serializer
    serializer.asDOMSerializer();
    // serialize the document
    serializer.serialize(xmlDoc);
    hope this helps!
    Rob.

  • Getting an XML string into BI

    Hi,
    I am loading data through flat files and have a field in te flat file which is an XML string. It is esentially a combination of characterisitic value embedded in one string. What should i do to pick specific values from the string and put it into a BW field. Can you give me an example, if we have to write a routine for that
    Thanks
    Rashmi.

    The issue got resolved with a routine in the transformations where specific characters were chosen.

  • Create Business Partner from XMl String not a file

    Hi,
    Is it possible to create a BP from an XML string. 
    I know about GetBusinessPartnerFromXml(string FileName, int index)
    but I dont want to save the string in a file before creating a BP from it
    Hope there's a method to do that

    Marc,
    This looks like it is a duplicate of this post, so I am closing this thread as it looks like you answered your own question!
    Create Business Partner from XMl String not a file
    Eddy

Maybe you are looking for

  • Calling a Web Service in Oracle Report Developer 10g?

    Hello, Does Oracle Report Developer 10g supports Web Services (calls) or XML files as a Data Source? If yes. From what version? Thanks.

  • Error while posting Goods issue

    Hi, I am trying to do a PGI for a delivery.It first goes to the "Detailed data for Handling unit XXXXXX" Screen and then if I click BACK , it goes to " Display Handling Units " Screen and then gives me an error : Risk of posting several mat. document

  • Table to find Non  Approved PO list in SRM

    Hi All, There is a requriement from the user to provide a spreadsheet for all the PO's awaiting for approval in SRM Can anybody help to provide the Table details to fetch these data Many Thanks Regards Prasanna

  • New forums jive multi-language support in NW2004s SPS12 missing

    Hi, according to the forums documentation it is possible to edit locale parameters in the adminstration console to change the language for forum users. But changing the language has no effect. Only english language is shown. I checked the SPS12 deplo

  • ITunes not fully changing email?

    I have just changed emails. I have changed my email information in my iTunes account. But now when i buy something through iTunes i get a email, at my new email saying "thank you for shopping itunes" and its just some random add. but my receipt still