Parse xml response from PL/SQL

Can anyone please help me parse the xml below?
DECLARE
   l_response     CLOB;
   g_system_id    VARCHAR2 (255);
   g_session_id   VARCHAR2 (255);
   g_user_id      VARCHAR2 (255);
BEGIN
   l_response :=
      '--uuid:18cb22a2-11cc-43f4-bfea-c213da179d30+id=156
Content-ID: <http://tempuri.org/0>
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="application/soap+xml"
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">http://tempuri.org/ILoginService/LoginByUserNameResponse</a:Action><a:RelatesTo>urn:uuid:cf410a05-23d4-4b92-a22c-329cbc19fbe7</a:RelatesTo></s:Header><s:Body><LoginByUserNameResponse xmlns="http://tempuri.org/"><LoginByUserNameResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="http://www.w3.org/2001/XMLSchema"><XObject.m_element i:type="x:string" xmlns="">&lt;OnlineContext SystemId="{19E0DDB4-5FA5-41EE-B624-AEA762865A6C}" SessionId="{F23D32A4-B325-4BFA-9E90-39CA253E843C}" UserId="{2C6ABE4C-D356-46F0-B4BE-9C4F0A36A522}" /&gt;</XObject.m_element></LoginByUserNameResult></LoginByUserNameResponse></s:Body></s:Envelope>
--uuid:18cb22a2-11cc-43f4-bfea-c213da179d30+id=156--';
      SELECT systemid, sessionid, userid
        INTO g_session_id, g_system_id, g_user_id
        FROM XMLTABLE (
                xmlnamespaces ('http://www.w3.org/2003/05/soap-envelope' AS "data"),
                'data:LoginByUserNameResponse/LoginByUserNameResult/XObject.m_element/OnlineContext'
                PASSING xmltype (l_response)
                COLUMNS systemid VARCHAR2 (50) PATH '@OnlineContext',
                        sessionid VARCHAR2 (50) PATH '@OnlineContext',
                        userid VARCHAR2 (50) PATH '@OnlineContext') xt;
   DBMS_OUTPUT.put_line (
         'Session id '
      || g_session_id
      || ' System id '
      || g_system_id
      || ' User id '
      || g_user_id);
END;
Thanks.

This gets you a little bit closer
declare 
-- Local variables here
l_response     CLOB;
g_system_id    VARCHAR2 (255);
g_session_id   VARCHAR2 (255);
g_user_id      VARCHAR2 (255);
begin
-- Test statements here
l_response := '<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"> 
<s:Header>
    <a:Action s:mustUnderstand="1">http://tempuri.org/ILoginService/LoginByUserNameResponse</a:Action> 
    <a:RelatesTo>urn:uuid:cf410a05-23d4-4b92-a22c-329cbc19fbe7</a:RelatesTo>
</s:Header>
<s:Body>
    <LoginByUserNameResponse xmlns="http://tempuri.org/"> 
       <LoginByUserNameResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="http://www.w3.org/2001/XMLSchema"> 
          <XObject.m_element i:type="x:string" xmlns=""><OnlineContext SystemId="{19E0DDB4-5FA5-41EE-B624-AEA762865A6C}" SessionId="{F23D32A4-B325-4BFA-9E90-39CA253E843C}" UserId="{2C6ABE4C-D356-46F0-B4BE-9C4F0A36A522}" /></XObject.m_element>
          </LoginByUserNameResult>
      </LoginByUserNameResponse>
  </s:Body>
</s:Envelope>';
    SELECT systemid, sessionid, userid
      INTO g_session_id, g_system_id, g_user_id
      FROM XMLTABLE (
              xmlnamespaces ('http://www.w3.org/2003/05/soap-envelope' AS "s", 
                             'http://tempuri.org/' as "data"), 
              's:Envelope/s:Body/data:LoginByUserNameResponse/data:LoginByUserNameResult/XObject.m_element/OnlineContext'
              PASSING xmltype (l_response)
              COLUMNS systemid VARCHAR2 (50) PATH '@SystemId',
                      sessionid VARCHAR2 (50) PATH '@SessionId',
                      userid VARCHAR2 (50) PATH '@UserId') xt;
DBMS_OUTPUT.put_line (
       'Session id '
    || g_session_id
    || ' System id '
    || g_system_id
    || ' User id '
    || g_user_id);
end;    
You will need to manually parse that CLOB and pull out the XML string itself from the response.  That can be done via SUBSTR and INSTR looking for the first < and last > in what you showed at least.  Updated from previous version to work properly with the xmlns="", which resets the default namespace back to the default value.  The XPath was corrected to reflect proper prefix usage.

Similar Messages

  • TO PARSE XML RESPONSE AFTER SENDING XML DOCUMENT AS URL PARAMETER PROBLEM

    Hi
    I sent the xml document (varchar variable)to the other site (to use URL).
    When I take the xml response from the other site, how can I parse this using pl/sql code? (db version oracle 8.1.7)
    What are the methods?
    Try the following URL by pasting it in browser location box:
    http://testspos.isbank.com.tr/sanalpos/spos.asp?prmstr='&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;ePaymentMsgVersionInfo="2.0" TT="Request" RM="Direct" CT="Money"&gt;&lt;OperationActionType="LiveTest"&gt;&lt;OpData&gt;&lt;MerchantInfo MerchantId="200000845966"MerchantPassword="kangurum"/&gt;&lt;ActionInfo&gt;&lt;TrnxCommon TrnxID="'||v_sipno||'"Protocol="156"&gt;&lt;/TrnxCommon&gt;&lt;/ActionInfo&gt;&lt;PANInfo&gt;&lt;/PANInfo&gt;&lt;OrgTrnxInfo&gt;&lt;/OrgTrnxInfo&gt;&lt;CustomData&gt;&lt;/CustoData&gt;&lt;/OpData&gt;&lt;/Operation&gt;&lt;/ePaymentMsg&gt;'
    You will get the response:
    &lt;html&gt;&lt;head&gt;&lt;title&gt;Error&lt;/title&gt;&lt;/head&gt;&lt;body&gt;The parameter is incorrect. &lt;/body&gt;&lt;/html&gt;

    Hi
    I sent the xml document (varchar variable)to the other site (to use URL).
    When I take the xml response from the other site, how can I parse this using pl/sql code? (db version oracle 8.1.7)
    What are the methods?
    Try the following URL by pasting it in browser location box:
    http://testspos.isbank.com.tr/sanalpos/spos.asp?prmstr='&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;ePaymentMsgVersionInfo="2.0" TT="Request" RM="Direct" CT="Money"&gt;&lt;OperationActionType="LiveTest"&gt;&lt;OpData&gt;&lt;MerchantInfo MerchantId="200000845966"MerchantPassword="kangurum"/&gt;&lt;ActionInfo&gt;&lt;TrnxCommon TrnxID="'||v_sipno||'"Protocol="156"&gt;&lt;/TrnxCommon&gt;&lt;/ActionInfo&gt;&lt;PANInfo&gt;&lt;/PANInfo&gt;&lt;OrgTrnxInfo&gt;&lt;/OrgTrnxInfo&gt;&lt;CustomData&gt;&lt;/CustoData&gt;&lt;/OpData&gt;&lt;/Operation&gt;&lt;/ePaymentMsg&gt;'
    You will get the response:
    &lt;html&gt;&lt;head&gt;&lt;title&gt;Error&lt;/title&gt;&lt;/head&gt;&lt;body&gt;The parameter is incorrect. &lt;/body&gt;&lt;/html&gt;

  • External Parser - XML to Pipe Delimited - Sql Loader BETTER DBMS_XMLSTORE

    Hi All,
    If I have got data in GIGs in a complex format.
    Can Using an External Java based XML Parser to convert XML to Pipe Delimited FIle and then Using SQL Loader
    BE BETTER THAN
    Using XSL to convert to Oracle <ROWSET> <ROW> Format and using DBMS_XMLSTORE to load data into tables.
    In terms of:
    Performace
    Scalability
    Exception Handling
    Regards....

    Go to the {forum:id=34} forum and look at the second page of the XML DB FAQ Thread (stickied to the top of the posts). While it doesn't compare using external tools to parse XML and load via SQL*Loader, it does talk about better ways to load large amounts of XML into the DB. This is also a good thread on the subject too from that forum, {thread:id=1096784}

  • Xml query hungs up with large xml response from utl_http request

    We are having very sensitive problem in Production environment with xmlquery.
    When receive a small or medium size xml, the query shown below works. But when the xml is large or very large its hung and slow down all the database.
    We are with Oracle 11gR2
    We are using clob to parse the response from the http request.
    What could be the problem or the solutions?. Please help. Its urgent...
    SELECT opciones_obj (x.strindice,
    x.nombrecompleto,
    x.nombre,
    x.strtipodato,
    x.codigoopcion,
    x.floatval,
    x.strtipo,
    x.strval)
    BULK COLLECT INTO t_opciones
    FROM XMLTABLE (
    xmlnamespaces (
    'http://schemas.xmlsoap.org/soap/envelope/' AS "env",
    'http://wsevaluarreglacondicioncomercial/' AS "ns0",
    'http://wsevaluarreglacondicioncomercial/types/' AS "ns1",
    'http://www.oracle.com/webservices/internal/literal' AS "ns2"),
    '/env:Envelope/env:Body/ns0:listarOpcionesAtributoEventoResponseElement/ns0:result/ns1:listaVariables/ns2:item/ns2:item'
    PASSING rsp_xml
    COLUMNS strindice VARCHAR2 (4000)
    PATH 'ns2:mapEntry[ns2:key="strIndice"]/ns2:value',
    nombrecompleto VARCHAR2 (4000)
    PATH 'ns2:mapEntry[ns2:key="nombreCompleto"]/ns2:value',
    nombre VARCHAR2 (4000)
    PATH 'ns2:mapEntry[ns2:key="nombre"]/ns2:value',
    strtipodato VARCHAR2 (4000)
    PATH 'ns2:mapEntry[ns2:key="strTipoDato"]/ns2:value',
    codigoopcion NUMBER
    PATH 'ns2:mapEntry[ns2:key="codigoOpcion"]/ns2:value',
    floatval FLOAT
    PATH 'ns2:mapEntry[ns2:key="floatVal"]/ns2:value',
    strtipo VARCHAR2 (4000)
    PATH 'ns2:mapEntry[ns2:key="strTipo"]/ns2:value',
    strval VARCHAR2 (4000)
    PATH 'ns2:mapEntry[ns2:key="strVal"]/ns2:value') x;

    What could be the problem or the solutions?1) Create an XMLType table (could be temporary) using binary XML storage :
    create table tmp_xml of xmltype
    xmltype store as securefile binary xml;2) In your procedure, load the XMLType containing the response (rsp_xml) into the table :
    insert into tmp_xml values (rsp_xml);3) Then, execute the query directly from the table :
    SELECT opciones_obj ( ... )
    BULK COLLECT INTO t_opciones
    FROM tmp_xml t
       , XMLTABLE (
             xmlnamespaces ( ... ),
             '/env:Envelope/env:Body/...'
             PASSING t.object_value
             COLUMNS ...4) At the end of the procedure, delete (or truncate) the table or simply let the table delete itself when the session ends (in case you created it TEMPORARY)

  • How to parse XML files from normal FTP Servers?

    I want to parse xml files from a normal FTP Servers , NOT the sap application severs itself. How can i do that?
    I know how to use the SAPFTP getting and putting files ,but I don't want to download and then parse it.
    Who knows how to parse it directly? I Just need to read the contents into a database.
    Thanks.

    I want to parse xml files from a normal FTP Servers , NOT the sap application severs itself. How can i do that?
    I know how to use the SAPFTP getting and putting files ,but I don't want to download and then parse it.
    Who knows how to parse it directly? I Just need to read the contents into a database.
    Thanks.

  • Xml response from rwservlet - timinginfo format

    Hello everyone,
    We've been running reports from database using the SRW package. After we upgraded to a newer version of Application Server (we may have upgraded more that just that) the reports stopped being run.
    I discovered that the problem is in the date/time format in the XML response from the report server. The SRW package is trying to convert the timinginfo string values to date using the following hardcoded date format:
    DATE_FORMAT CONSTANT VarChar2(22) := 'MM/DD/YY HH:MI AM'; -- Date-Format used to convert the timing-info
    However, the date format in the response coming back from the server is different - see below.
    <?xml version = '1.0' encoding = 'ISO-8859-1' standalone = 'yes'?>
    <serverQueues>
    <job id="4314" queueType="current">
    <name>SysEmailRequest</name>
    <type>report</type>
    <status code="1">Waiting in the queue</status>
    <owner>RWUser</owner>
    <server>windev2006dev2006</server>
    <destination>
    <desType>EmailSysoeDes</desType>
    <desName>PMRFI</desName>
    <desFormat>pdf</desFormat>
    </destination>
    <timingInfo>
    <queued>Jul 28, 2006 9:51:48 AM</queued>
    <started>Jul 28, 2006 9:51:48 AM</started>
    <finished>Jul 28, 2006 9:51:48 AM</finished>
    </timingInfo>
    </job>
    </serverQueues>
    Does anyone know where to set the date format for timinginfo?
    I don't want to just modify the format in the SRW package without knowing why it changed.
    Thanks in advance,
    Rasto Sadecky

    Hello,
    The reports server uses the "machine's locale" to format the date.
    You can use the jvmoptions parameter to specify another user.language :
    rwserver server=repserver jvmoptions="-Duser.language=xx"
    Regards

  • Parsing XML files from application server

    I need to read  an XML file from the application server. This can be done using OPEN DATASET in BINARY MODE and reading into internal table of type binary data.
    But inorder to parse the document using the iXML library, i need to pass the filesize of the XML file that is read into internal table.
    Please let me know how to calculate this filesize ?

    Hi ,
    Check the FM : /SAPDMC/LSM_F4_SERVER_FILE.
    Inside this FM , subroutine below exists.The main program for routine is /SAPDMC/LLSMW_AUX_020F02.
    Call this routine from your program. You will get the length in bytes from the field len of table pt_file.
    data:
      begin of gs_file,
        directory(75) type c,              " name of directory.
                                           " (possibly truncated.)
        name(75)    type c,                " name of entry.
                                           " (possibly truncated.)
        type(10)    type c,                " type of entry: directory, file
        *len(8)      type p,                " length in bytes*
        owner(8)    type c,                " owner of the entry
        mtime(6)    type p,                " last modification date,
                                           " seconds since 1970
        mode(9)     type c,                " like "rwx-r-x--x":
                                           " protection mode
        errno(3)    type c,
        errmsg(40)  type c,
        mod_date    type d,
        mod_time(8) type c,                " hh:mm:ss
        subrc like sy-subrc,
    end of gs_file.
    DATA : pt_file LIKE TABLE OF gs_file.
    DATa : p_ok.
      PERFORM /sapdmc/llsmw_aux_020f02(directory_contents_get)
      TABLES   pt_file
                                USING    '/TMP' ""!!! Here is your filepath
                                CHANGING p_ok

  • Creating an XML file from multiple sql tables

    I have very little xml experience, but need to generate an xml file from multiple table. I know what the output needs to look like, but do not know how to setup the code. Any help would be appreciated.
    - <Practice SourceID="EPIC" ExternalPracticeID="PPAWB">
    - <Provider ExternalProviderID="TB2" FirstName="THOMAS G" LastName="BREWSTER">
    - <Patient ExternalPatientID="99999" OldExternalPatID="" FirstName="test" MiddleName="J" LastName="test" Gender="M" DateOfBirth="2005-08-12" SocSecNumber="000-00-0000" LanguageID="22" AddressOne="test" AddressTwo="" City="test" StateID="20" ZipCode="99999" DayPhone="" EveningPhone="207-999-9999" StatusID="">
    <Measure MeasureID="2" MeasureValue="5" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="2" MeasureValue="5" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="3" MeasureValue="1" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="3" MeasureValue="1" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="32" MeasureValue="3" MeasureDate="2008-10-24 13:51:00" />
    <Measure MeasureID="33" MeasureValue="1" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="33" MeasureValue="1" MeasureDate="2009-02-09 10:09:00" />
    <Measure MeasureID="4" MeasureValue="5" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="4" MeasureValue="5" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="40" MeasureValue="2008-10-24 13:43:00" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="40" MeasureValue="2008-10-24 14:23:00" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="41" MeasureValue="2008-10-24 13:43:00" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="41" MeasureValue="2008-10-24 13:51:00" MeasureDate="2008-10-24 13:51:00" />
    </Patient>
    </Provider>
    </Practice>

    You are interested in XMLElement and probably XMLAgg. Since you didn't list a version, I can't provide links to the corresponding documentation. I cringe at all the attributes on the Patient element as that info should really be elements.
    To create the Measure node, your overall SQL statement may look something like (not tested)
    SELECT XMLElement....
              XMLAgg(SELECT XMLElement
                       FROM measures_table
                      WHERE join condition to parent)
      FROM patient,
           provider,
           practice
    WHERE join conditionsFor additional help, please include your version (4 digits), some sample data, and what you have tried.

  • Error parsing XML file from a HttpServletRequest using JAXP

    Hi,
    I am trying to generate an XML file from an HttpServletRequest. I am actually using file uploading method in JSP to send the XML file. I think the parser isnt able to correctly identify the XML file from the message body and hence it is giving some strange error messages. Has anyone of u managed to solve this problem ?
    Code snippet:
    //now build an XML document from the requested input stream
    InputStream in = myRequest.getInputStream();
    try {
    myDocRequest = myParser.parse(in);
    } catch (Throwable t) {
    throw new Exception("Could not build document",t);
    Error message is:
    [Fatal Error] :1:1: Content is not allowed in prolog.
    java.lang.Exception: Could not build document
    at XMLUtil.<init>(XMLUtil.java:91)
    at WCS.doPost(WCS.java:44)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:534)
    Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
    at XMLUtil.<init>(XMLUtil.java:89)
    ... 20 more
    Actually if i just print out the message, it gives something like this:
    -----------------------------7d63dc71b06b2
    Content-Disposition: form-data; name="W"; filename="C:\work_projects\Capas.xml"
    Content-Type: text/xml
    <?xml version="1.0" encoding="UTF-8"?>
    <GetCapabilities version="1.0.0" service="wcs">
    <section>/WCS_Capabilities/Capability</section>
    </GetCapabilities>
    -----------------------------7d63dc71b06b2--
    Cheers.

    The ServletInput stream contains this:
    -----------------------------7d63dc71b06b2
    Content-Disposition: form-data; name="W"; filename="C:\work_projects\Capas.xml"
    Content-Type: text/xml
    <?xml version="1.0" encoding="UTF-8"?>
    i.e., its the HTTP File Upload MIME stuff, followed by the XML. You need to wrap around the input stream something that can decode the HTTP MIME stuff and let you get at the XML itself, i.e., something like: com.orielly.servlet.multipart.MultipartParser (Apache has a similar 'file upload servlet).
    Jeremy

  • How to use java to create an XML document from an SQL database?

    Hi,
    I'm a complete novice at XML and have only recently started programming in Java.
    I'm currently trying to develop a package in Java 1.1.8 which requires a set of very specifically formatted XML documents. These documents would need to be updated regularly by people with no knowledge of Java and I would like to make it as simple as possible.
    Since the data will already be in an SQL database, I thought it might be possible to generate the XML documents from the data using a small Java application, but I'm not too sure how to go about this or if this is even possible! Any help or pointers in the right direction would be very much appreciated.
    Louise

    Do you have the option of upgrading to a newer version of the JDK?
    JAXB does what you are wanting very easily. Also there are tools if you don't want to write your own. JAXB is available as early release on Sun's site as is the newest JDK. Otherwise, you have to design a factory and interface that will do this for you (which is what JAXB basically is in a very simplified view).

  • Group xml data from different sql queries in data template

    Hello,
    I need to do a mailing program with bursting that sends differents alerts in one mail.
    For example i can have alerts for late orders, alerts for shipping not confirmed, so really different address (I dont want to use union). I have done three sql statement in data template , it gives the following ouput.
    <GA_EMAIL>[email protected]</GA_EMAIL>
    <G_ALERTS_1>
    <ALERT>
    </ALERT>
    <ALERT>
    </ALERT>
    </G_ALERTS_1>
    </GA_EMAIL>
    <GA_EMAIL>[email protected]</GA_EMAIL>
    <G_ALERTS_1>
    <ALERT>
    </ALERT>
    </G_ALERTS_1>
    </GA_EMAIL>
    <GA_EMAIL>[email protected]</GA_EMAIL>
    <G_ALERTS_2>
    </G_ALERTS_2>
    </GA_EMAIL>
    I woud like the bursting or data template to group alerts when email is the same, because here it sends an email for each different alert.
    Ideal output would be:
    <GA_EMAIL>[email protected]</GA_EMAIL>
    <G_ALERTS_1>
    <ALERT>
    </ALERT>
    <ALERT>
    </ALERT>
    </G_ALERTS_1>
    <G_ALERTS_2>
    </G_ALERTS_2>
    </GA_EMAIL>
    But I don't know how to group different sql statements on a common field (email)
    Any ideas ?
    Thanks

    the for-each group works well in a rtf template, but the rtf template is only applied after the bursting (in order I get first data template (instead of a report) -> bursting -> rtf template)
    I want to be able to group xml data from the data template, so I can do bursting (by email ) but only once per mail.

  • Need to Parse XML Message from my Message Driven Bean

    Hi
    I am using Message Driven Beans for listening to a Queue .
    I am getting a Big XML file from my Queue in form of a TextMessage .
    Now my task is to read / parse the XML Message .
    Please tell me what is the appropiate parsing technique i need to use (Should i use SAX or DOM )
    Please share your ideas .
    Thank you .

    Generally you want to use SAX if the file is so big that loading it all in memory (as DOM does) will create memory problems.
    Read about these methods on the wiki page for [JAXP.|http://en.wikipedia.org/wiki/Java_API_for_XML_Processing]

  • SOAP Response from PL/SQL Web Service

    My returned SOAP xml from PL/SQL web service has totally rearranged element order, which defined in WSDL and oracle database. It also changed all element name from mixed upper/lower case to pure lower case and makes them hard to read. Why is that? Is there any way to avoid these to happen?
    My PL/SQL web service was generated by Oracle9i JDeveloper 9.0.3.
    Thanks for any help.
    Yi

    Hi,
    we need more details
    - it seems like you have both Return and OUT arguments; which SOAP stack are you using?
    - which tools?
    - What is the naming convention of your PL/SQL arguments?
    Kuassi
    Mike,
    1. The SOAP is the result of publishing a stored procedure/function as a Web service.
    2. The elements for returned data are re-ordered. The function returns no complex type.
    3. The element tags containing returned data are all changed to lower case.
    Here are what I expected for returning SOAP:
    <return xmlns:ns2="http://oracle817/IDemogprofilews.xsd" xsi:type="ns2:oracle817_ODemog">
    <OFipsCode xsi:type="xsd:string">51059</ OFipsCode >
    <TotalPopulation xsi:type="xsd:double">818584.0</ TotalPopulation >
    <PercentMinority xsi:type="xsd:double">22.5</ PercentMinority >
    <PersonsBelowPovertyLevel xsi:type="xsd:double">28210.0</ PersonsBelowPovertyLevel >
    <HouseholdsInArea xsi:type="xsd:double">292943.0</ HouseholdsInArea >
    <HousingUnitsBuiltBefore1950 xsi:type="xsd:double">5.2</ HousingUnitsBuiltBefore1950 >
    <White xsi:type="xsd:double">666349.0</ White >
    <HispanicOrigin xsi:type="xsd:double">50526.0</ HispanicOrigin >
    <AmericanIndian xsi:type="xsd:double">2318.0</ AmericanIndian >
    <HighSchoolDiploma xsi:type="xsd:double">91675.0</ HighSchoolDiploma >
    <BachelorAndHigher xsi:type="xsd:double">264673.0</ BachelorAndHigher >
    <Adults18yearsAndOlder xsi:type="xsd:double">618989.0</ Adults18yearsAndOlder >
    <Seniors65yearsAndOlder xsi:type="xsd:double">52977.0</ Seniors65yearsAndOlder >
    Instead I get following back:
    <return xmlns:ns2="http://oracle817/IDemogprofilews.xsd" xsi:type="ns2:oracle817_ODemog">
    <totalpopulation xsi:type="xsd:double">818584.0</totalpopulation>
    <americanindian xsi:type="xsd:double">2318.0</americanindian>
    <housingunitsbuiltbefore1950 xsi:type="xsd:double">5.2</housingunitsbuiltbefore1950>
    <hispanicorigin xsi:type="xsd:double">50526.0</hispanicorigin>
    <highschooldiploma xsi:type="xsd:double">91675.0</highschooldiploma>
    <adults18yearsandolder xsi:type="xsd:double">618989.0</adults18yearsandolder>
    <seniors65yearsandolder xsi:type="xsd:double">52977.0</seniors65yearsandolder>
    <householdsinarea xsi:type="xsd:double">292943.0</householdsinarea>
    <personsbelowpovertylevel xsi:type="xsd:double">28210.0</personsbelowpovertylevel>
    <ofipscode xsi:type="xsd:string">51059</ofipscode>
    <bachelorandhigher xsi:type="xsd:double">264673.0</bachelorandhigher>
    <white xsi:type="xsd:double">666349.0</white>
    <percentminority xsi:type="xsd:double">22.5</percentminority>
    You can see the element tag names are in different order/sequence and cases.
    Thanks.
    Yi

  • XML Data from PL/SQL procedure -- special character issue (eBS)

    Hi All,
    I am developing a report, where the XML data is created by a PL/SQL procedure. I chose this approach over a data template, since there is a lot of processing involved in producing the actual data, and it cannot be done by select-statements alone. The report is run as a regular concurrent request.
    So far so good. There is a problem though. Every time the data contains special characters (ä, ö, umlauts), the concurrent request is completed with a warning, the log confirms that "One or more post-processing actions failed.", also there is no output file. The XML structure is valid as such. The report runs smoothly and produces the output when the XML data does not contain special characters.
    I am producing the XML lines by using the standard FND_FILE.PUT_LINE procedure: Fnd_File.put_line(Fnd_File.output, '<?xml version="1.0" encoding="UTF-8"?>'); This seems like a character encoding issue, but declaring the UTF-8 encoding in this way does not solve the problem.
    Any ideas what can be done to fix this? I have been searching Metalink but cannot find an answer. Many thanks for your kind help.
    Best Regards, Matilda

    Hi Rajesh,
    One idea I have, is that it might be possible to modify the PL/SQL code into a "before report" type trigger, attached to a data template. The code would process the data and write the lines into a temporary table, from which the data template could retrieve them in a simple select-query. However, it would be neat to be able to solve this without adding an extra layer of processing, since BI Publisher supposedly supports PL/SQL procedures as the data source.
    The data in this case is all correct, special characters are an intrinsic feature of the Finnish language. :)
    Best Regards, Matilda

  • JDev generated webservices encodes XML output from PL/SQL procedure

    I have a PL/SQL packaged procedure which takes some input parameters and produces one output parameter. The output parameter is of type CLOB and after the procedure has run, it contains a big piece of XML data.
    Using JDeveloper 10.1.3.1, I've published this packaged procedure as a webservice. The generated webservice is fine and works, except for one tiny little issue: the XML that is taken from the output parameter is encoded.
    Here is an example of the SOAP message that the webservice returns:
    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ns0="http://gbv0300u/GBV0300U.wsdl/types/"><env:Body><ns0:gbv0300uResponse
    Element><ns0:result><ns0:obvglijstOut> & gt;type>GBV0001& gt ;/type& lt;
    & gt;diensten& lt;
    & gt;dienst>some value& gt;/dienst& lt;
    & gt;/diensten& lt;
    </ns0:obvglijstOut></ns0:result></ns0:gbv0300uResponseElement></env:Body></env:Envelope>
    (I've manually added an extra space between the & and lt; or gt; to make sure a browser will not translate it into a < or >!)
    The contents of the <ns0:obvglijstOut> element are filled with the output parameter from the PL/SQL package.
    How can I change the generated webservice, so the output from the PL/SQL package is used as is instead of being encoded?

    Update: I've tested a bit more by adding some output statements to the java code that JDeveloper generated. I'm now 100% sure the PL/SQL code gives the XML data correctly to the webservice.
    At this moment my guess is that somewhere in the WSDL definition there is something that enables the encoding of the data. But I'm not sure.
    Any help is greatly appreciated.

Maybe you are looking for

  • Folios not updating

    Our multi-folio content needs some updates. I have followed these steps: 1. Updated the source files in INDD with the content updates. 2. Updated the articles in the Folio Builder panel 3. Updated the folios in Folio Producer There have not been any

  • LSMW issue while changing Customer(XD02)

    Hi Experts, I need to update the Bank details for single customer. Actual Issue: I can insert a Bank details for a customer from flat file but if a customer has two Bank details(assume as line item) then how to handle this type of scenario using LSMW

  • Preview opens downloads

    I am downloading files from a clip art website. The file is a .sit, and unstuffs as soon as it hits my desktop. The problem is, after it unstuffs to the EPS file, Preview opens it as a PDF view. I don't want Preview to automatically open the file. I

  • Adobe player and reader -updates and now cannot open new Email, reply Email or attached PDF's. Fix?

    On my Windows PC, Win 7, 64 bit, I have Adobe Reader and Adobe Player. a week or two or more I have had messages of Adobe updates and downloaded and installed them, but I think after these (could also be after Windows updates) I cannot open a new Ema

  • JFileChooser.showSaveDialog ()

    I have to save a file using JFileChooser fc=new JFileChooser() //a dded all the filters fc.showSaveDialog(); If we write a file name in the file name text box of chooser and pressed SAVE button, Its saving with the selected file name. But I have to a