Problem extracting the content of a big xml data
Hello
I'm trying to use a web service that needs and returns big messages (>1Mo).
Could you tell me if I do something wrong ? (I have a problem with the extract function at the end of the process)
For this I modified the soap_api package to use clob for the envelope instead of varchar2.
Sending a message works well, I modified the part of the invoke function that does this to
send the message chunked :
generate_envelope(p_request, l_envelope, p_type);
--show_envelope(l_envelope);
l_http_request := UTL_HTTP.begin_request(p_url, 'POST','HTTP/1.1');
UTL_HTTP.set_header(l_http_request, 'Content-Type', 'text/xml');
UTL_HTTP.set_header(l_http_request, 'Content-Length', LENGTH(l_envelope));
UTL_HTTP.set_header(l_http_request, 'Transfer-Encoding', 'chunked' );
UTL_HTTP.set_header(l_http_request, 'SOAPAction', p_action);
--UTL_HTTP.write_text(l_http_request, l_envelope);
v_clob_length := dbms_lob.getlength(l_envelope);
loop
if (v_end > v_clob_length) then
v_end := v_clob_length;
v_length := v_end - v_start + 1;
end if;
v_chunk_data := null;
v_chunk_data := DBMS_LOB.SUBSTR(l_envelope, v_length, v_start);
UTL_HTTP.write_text(l_http_request, v_chunk_data );
if (v_end = v_clob_length) then
exit;
end if;
v_start := v_end + 1;
v_end := v_start + 2000;
end loop;
After that I modified the function to retrieve the message line by line instead of in one block :
l_http_response := UTL_HTTP.get_response(l_http_request);
--UTL_HTTP.read_text(l_http_response, l_envelope);
l_envelope := null;
begin
LOOP
utl_http.read_line(l_http_response, v_line, TRUE);
v_line_clob := v_line;
l_envelope := l_envelope || v_line_clob;
END LOOP;
UTL_HTTP.end_response(l_http_response);
exception
WHEN utl_http.end_of_body THEN
utl_http.end_response(l_http_response);
end;
--show_envelope(l_envelope);
l_response.doc := XMLTYPE(l_envelope);
l_response.envelope_tag := p_request.envelope_tag;
(I modified the show_envelope function to save the xml in a file and the message is completed and the creation of the xmltype returns no errors)
But the last part that I didn't change doesn't work :
l_response.doc := l_response.doc.extract('/' || l_response.envelope_tag || ':Envelope/' || l_response.envelope_tag || ':Body/child::node()',
'xmlns:' || l_response.envelope_tag || '="http://schemas.xmlsoap.org/soap/envelope/"');
show_envelope(l_envelope);
It should remove the <soap:Envelope> and <sopa:Body> part but they still exists after the extract.
This is an example of the xml I receive from the web service :
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><getResultTestRetourStringResult xmlns="http://www.verlingue.fr/WSCalculTarificateur/"><Resultat>
</Resultat></getResultTestRetourStringResult></soap:Body></soap:Envelope>
Maybe because you are using l_envelope when calling show_envelop?
l_response.doc := l_response.doc.extract('/' || l_response.envelope_tag || ':Envelope/' || l_response.envelope_tag || ':Body/child::node()',
'xmlns:' || l_response.envelope_tag || '="http://schemas.xmlsoap.org/soap/envelope/"');
show_envelope(l_envelope);
It's really hard to tell from your snippets of code, some of which have nothing to do with the issue. The following works for me just fine on 11.1.0.6
declare
l_doc XMLTYPE;
l_snip XMLTYPE;
begin
l_doc := XMLTYPE('<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<getResultTestRetourStringResult xmlns="http://www.verlingue.fr/WSCalculTarificateur/">
<Resultat></Resultat>
</getResultTestRetourStringResult>
</soap:Body>
</soap:Envelope>');
l_snip := l_doc.extract('/a:Envelope/a:Body/*','xmlns:a="http://schemas.xmlsoap.org/soap/envelope/"');
dbms_output.put_line(l_snip.getStringVal);
end;
produces
<getResultTestRetourStringResult xmlns="http://www.verlingue.fr/WSCalculTarificateur/">
<Resultat/>
</getResultTestRetourStringResult>
I also get the same thing when using child::node() instead of *
You'll notice that my namespace prefixes do not agree with what's in the XML. That's okay. Only the URI matters, not the prefix itself. Since your URI is hard-coded, you could simplify the XPath as I showed so that it is easier to read.
Welcome to the forums.
Here is an always helpful read.
Re: 2. How do I ask a question on the forums?
Similar Messages
-
I have put a lot of work into a docx document on my Mac, but now can't open it as it gives the error message: 'the Open XML file cannot be opened because there are problems with the contents. Details, Unspecific
error, Location: 2'
When opening the original file the message said: 'this file contains word 2007 for Windows equations' etc. but I managed to track changes fine, and saved, closed and re-opened it numerous times without problem. Some graphs seemed moved, and various formulas
were illegible, but no other weirdness was observed.
I have microsoft 2008 installed on my Mac OS X version 10.6.8.
I've tried to fix it using various solutions suggested here, but am afraid am too IT illiterate to have had any luck, please help I'm new to all this!
I've uploaded it to https://www.dropbox.com/s/hkw9k6lyihzoxpc/SittwayPauktawSQUEACREPORT_KD%2BCH.docxHi,
This issue is related strictly to oMath tags and occurs when a graphical object or text box is anchored to the same paragraph that contains the equation.
Please use the "Fix it" tool in the following KB article to resolve the problem. See:
http://support.microsoft.com/kb/2528942
Hope this helps.
Regards,
Steve Fan
TechNet Community Support -
How to extract the nodes of any given XML document ???
Hello,
Greetings! It is an interesting forum.
A Snippet of XML Schema PurchaseOrder.xsd as given in user guide is as follows
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xdb="http://xmlns.oracle.com/xdb"
version="1.0" xdb:storeVarrayAsTable="true">
<xs:element name="PurchaseOrder" type="PurchaseOrderType"
xdb:defaultTable="PURCHASEORDER"/>
<xs:complexType name="PurchaseOrderType" xdb:SQLType="PURCHASEORDER_T">
<xs:sequence>
<xs:element name="Reference" type="ReferenceType" minOccurs="1"
xdb:SQLName="REFERENCE"/>
<xs:element name="Actions" type="ActionsType" xdb:SQLName="ACTIONS"/>
<xs:element name="Reject" type="RejectionType" minOccurs="0"
xdb:SQLName="REJECTION"/>
<xs:element name="Requestor" type="RequestorType"
xdb:SQLName="REQUESTOR"/>
<xs:element name="User" type="UserType" minOccurs="1"
xdb:SQLName="USERID"/>
<xs:element name="CostCenter" type="CostCenterType"
xdb:SQLName="COST_CENTER"/>
<xs:element name="ShippingInstructions" type="ShippingInstructionsType"
xdb:SQLName="SHIPPING_INSTRUCTIONS"/>
<xs:element name="SpecialInstructions" type="SpecialInstructionsType"
xdb:SQLName="SPECIAL_INSTRUCTIONS"/>
<xs:element name="LineItems" type="LineItemsType"
xdb:SQLName="LINEITEMS"/>
</xs:sequence>
</xs:complexType>
full schema is available in url
http://download-west.oracle.com/docs/cd/B12037_01/appdev.101/b10790/xdb03usg.htm#BABBGIED
The views use XPath expressions and functions such as extractValue() to define the mapping between columns in the view and nodes in the XML document. The following view is created on purchase order schema.
Creating Relational Views On XML Content
CREATE OR REPLACE view PURCHASEORDER_MASTER_VIEW
(REFERENCE, REQUESTOR, USERID, COSTCENTER,
SHIP_TO_NAME,SHIP_TO_ADDRESS, SHIP_TO_PHONE,
INSTRUCTIONS)
AS
SELECT extractValue(value(p),'/PurchaseOrder/Reference'),
extractValue(value(p),'/PurchaseOrder/Requestor'),
extractValue(value(p),'/PurchaseOrder/User'),
extractValue(value(p),'/PurchaseOrder/CostCenter'),
extractValue(value(p),'/PurchaseOrder/ShippingInstructions/name'),
extractValue(value(p),'/PurchaseOrder/ShippingInstructions/address'),
extractValue(value(p),'/PurchaseOrder/ShippingInstructions/telephone'),
extractValue(value(p),'/PurchaseOrder/SpecialInstructions')
FROM PURCHASEORDER p;
When we register XML Schema in Oracle 9i, the schema elements of XML documents are stored as XMLType, that is, stored using object-relational storage techniques.
For a small schema, we could build the above view manually, but for large/nested schema, if we have query to build XML documents node list, it will help us to build Relational Views on XML Content.
How do we extract the nodes of any given XML document through O-R structures or XML DB using XML DB functions?
Any alternate thoughts are welcome.
I appreciate your help.
Regards
RamRam
Once again, I do not think that you can solve the problem you are trying to solve. Fundamentally you need to determine for a given element of a given complex type what are it's child elements. For each of those elements you then need to find out whether or not it in turn has child elements...
Then you have to think about elements defined as ref rather than type, elements that are substituteable, and the rest of possibilities that can be described with XML Schema.
If you can solve that problem you're a better man than I as the saying goes. Anyone rather than give you a fish, I'll show you how to at least put a worm on the hook..
The following query gets the names of the elements inside a each of the global complex types
Good luck, if you come up with a query to do this I'd love to see it...
SQL> column COMPLEX_TYPE format A32
SQL> column ELEMENT format A32
SQL> --
SQL> select extractvalue
2 (
3 value(ct),
4 '/xs:complexType/@name',
5 'xmlns:xs="http://www.w3.org/2001/XMLSchema"'
6 ) COMPLEX_TYPE,
7 extractvalue
8 (
9 value(et),
10 '/xs:element/@name',
11 'xmlns:xs="http://www.w3.org/2001/XMLSchema"'
12 ) ELEMENT
13 from resource_view,
14 table
15 (
16 xmlsequence
17 (
18 extract
19 (
20 res,
21 '/r:Resource/r:Contents/xs:schema/xs:complexType',
22 'xmlns:r="http://xmlns.oracle.com/xdb/XDBResource.xsd"
23 xmlns:xs="http://www.w3.org/2001/XMLSchema"')
24 )
25 ) ct,
26 table
27 (
28 xmlsequence
29 (
30 extract
31 (
32 value(ct),
33 '/xs:complexType/*/xs:element',
34 'xmlns:xs="http://www.w3.org/2001/XMLSchema"'
35 )
36 )
37 ) et
38 where equals_path(res,'/home/SCOTT/poSource/xsd/purchaseOrder.xsd') = 1
39 /
COMPLEX_TYPE ELEMENT
-------------------------------- ------------------------PurchaseOrderType Reference
PurchaseOrderType Actions
PurchaseOrderType Reject
PurchaseOrderType Requestor
PurchaseOrderType User
PurchaseOrderType CostCenter
PurchaseOrderType ShippingInstructions
PurchaseOrderType SpecialInstructions
PurchaseOrderType LineItems
LineItemsType LineItem
LineItemType Description
LineItemType Part
ActionsType Action
RejectionType User
RejectionType Date
RejectionType Comments
ShippingInstructionsType name
ShippingInstructionsType address
ShippingInstructionsType telephone
19 rows selected. -
I created a site and created a document libarary and assigned a word document as a content type . I have written a workflow to create a new document . The workflow is working fine and all the document is getting created and values are getting stored
in it .
As per my requirement I am saving the above site as site template .
After that I am creating a new site based on the above site template , Its getting created and I started the workflow , its working fine and the document is also getting created .
The problem is I am getting error while opening the word document
Error - The file filename.docx cannot be opened because there are problems with the contents .
Details - No error details availble .
IndreshWhat are you doing within the txt document? Is it general text and string based items, or have you something more elaborate going on?
An older discussion here elaborates a bit more on the dotx vs docx side of things.
http://social.msdn.microsoft.com/Forums/en-US/de1b5ff9-ea6d-460c-a707-8c28acd4906f/error-opening-office-open-xml-file-when-using-sd-workflow-to-create-item-in-document-library?forum=sharepointcustomizationlegacy
Steven Andrews
SharePoint Business Analyst: LiveNation Entertainment
Blog: baron72.wordpress.com
Twitter: Follow @backpackerd00d
My Wiki Articles:
CodePlex Corner Series
Please remember to mark your question as "answered" if this solves (or helps) your problem. -
PHDS - problem with the content license
Hi, I have just enabled the basic phds settings in my httpd.conf (ie not the PHDSCommonKeyFile / PHDSPlaybackExpiration / PHDSOutputProtection / PHDSVideoEncryptionLevel) settings:
<IfModule jithttp_module>
<Location /hds-vod>
HttpStreamingJITPEnabled true
JitFmsDirPath ".."
HttpStreamingContentPath "/full/location/to/content"
HttpStreamingJITConfAllowed false
EncryptionScope server
ProtectionScheme phds
Options -Indexes FollowSymLinks
</Location>
</IfModule>
And whilst when hitting the video_bitrate.mp4.f4m file i get the expected xml back with the drmAdditionalHeader element, when I view it in the adobe multibitrate hds player i get the error "There was a problem with the content license., plesae contact your video service provider" - has anyone seen this before?
ThanksHi, the "adobe multibitrate hds player" is the one you see on the http://server:8134 home page.
I installed 4.5.3 from scratch and left all the defaults with the exception of EncryptionScope server & ProtectionScheme phds - the http error log showed the below when visiting http://server:8134 - [Mon Oct 01 08:34:18 2012] [debug] mod_headers.c(756): headers: ap_headers_output_filter()
The player does say in the bottom right "This video content is DRM protected" and the crossdomain.xml exists and looks like:
<cross-domain-policy>
<allow-access-from domain="*"/><site-control permitted-cross-domain-policies="master-only"/>
</cross-domain-policy> -
How to extract the content of a mail message?
Friends,,,
How to extract the content of a mail message?
the message does not contain any attachments or images.
its just a plain text..
if i use message.getContent(), in addition of the content it returns headers information also...
but i need only the content of that message...
if i write code like this:
String content = (String) message.getContent();
it gives cast exception...
if the message contains only plain text, no multipart, then which method is useful to extract only the content?
please tell me friends..
thanks in advannce,
regards,
Venkata NaveenMessage.getContent() does not return headers for a simple text/plain
message. If you're getting headers, something else is wrong.
Also, casting the result to String should work.
Most likely the message really isn't a simple text/plain message.
Provide more details and we'll help you figure out what you're
doing wrong.
Also, please read the msgshow.java demo program included with JavaMail. -
How to extract the content of a user uploaded txt file in web dynpro?
Hi,
I'm working on a java web dynpro component. This component consists of document upload field, where users should be able to upload .txt documents. These uploaded text documents should then be somehow read, and thir content displayed. I am already able to upload documents using the upload field, and store it in the context, but I'm still not able to extract the content of these text documents for displaying.
Does anyone have any suggestions of how I could do this?
Any help will be greatly appreciated!
Thanks!Hi Alain,
You can do through this document on how to upload/download files in Webdynpro.
[https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/202a850a-58e0-2910-eeb3-bfc3e081257f]
Once you have the uploaded file in your context if you are storing it as a byte array then convert it to a string using the String constructor String(byte[] bytes) and then you can store this string in an attribute of type String which could be bound to a UI element (TextArea) to display the contents.
If you are using an IWDResource then you will get an inputstream from which you can read the data and convert it to a string for display as mentioned above.
Hope this helps.
Sanyev -
How to extract the contents of the Jar file?
Hello,
Can anyone tell me how to extract the contents of the Jar file?
An example will be highly appreciated.
Thanks.From command line, or from within a java application?
Kaj
Btw. Why do you need to do it. You do know that you can add jars to the classpath and read resources from them without extracting the file? -
Is it possible to extract the contents of any PDF file using Adobe PDF SDK?
Is it possible to extract the contents of any PDF file using Adobe PDF SDK?
For Example: There is one pdf file. Let us say xxx.pdf with 32 pages. I am interested in only in a topic present at 10th page. Can I extract this information and save it into another pdf file (means new pdf file)?Thanks Irosenth,
I am actually interested in extract the page and create a new PDF with that page. But still there is a catch that on which basis the page needs to extract either on PAGE number OR on Bookmark basis.
But here in this scenario assume I am looking for the PDF file, now I want to save only page 5. How can I extract page 5 automatically/programmatuically? Or in simple word how can I get the reference link of page 5?
Here I am not getting clear picture that Do I need both SDK Adobe & Acrobat to achieve this requirement. And more over you have mentioned that SDK itself is free. But on Adobe side it is mentioned that it is available by license only with this I have another doubt: To work my desktop/system application with Adobe PDF library, this library needs to distribute with the application. So in this case will it be chargeable for each and every deployment.
Could you please provide me the link from where I can download the SDK? So that I can do some excerise with SDK to figure out the exact flow of functionality to work with my application. -
Extract the content of word document
Hi Experts,
I need to extract the content of word document in to an internal table using OLE automation.
Suggest us with a sample code or any FM.
Regards
PaulOne way or probably Only way I can think off is using HWPF for reading/writing MS Word documents. It is a Jakartha project which is still under development though. I was able to read and Write WORD documents pretty nicely. Like I said, HWPF is still under development . You can still try using it, it is quite simple. Let me know if need help with coding using HWPF, I used it before. Check out the following link.
http://jakarta.apache.org/poi/hwpf/index.html.
Hope that helps. Thanks. -
Extracting the Attributes values of an XML Element
Dear Forum Members
Please tell me any XML Function which is used to extract the Attribute value of an XML Element.
Given below
<BRKCD_STREDSWTINVIN_C Key="6708">
is an Element With some Key value.
I want to have that Key value.
Using Extract and Extractvalue I am not able to get the Attribute value.
Is there any way..
Regards
Madhu KYour xml is not really complete ;), but this should get you started:
michaels> with t as
(select xmltype('<BRKCD_STREDSWTINVIN_C Key="6708"></BRKCD_STREDSWTINVIN_C>') xml from dual)
select d.xml, d.xml.extract('//BRKCD_STREDSWTINVIN_C/@Key') key
from t d
XML KEY
<BRKCD_STREDSWTINVIN_C Key="6708"></BRKCD_STREDSWTINVIN_C> 6708 -
my ipod uses 10.2 software, but iphone5 wants 10.7version, will this pose any problems with the content currently in itunes if I downloand straight from itunes.com?
Your content is stored locally on your computer, when you update, it will not mess with your content at all.
-
"The file .docx cannot - problems with the contents."
Word 2007 file HELP!
I started a paper this morning and saved it as normal, however when I try to reopen it I get the following messege: The file .docx cannot be opened because there are problems with the contents. Does anyone know how to resolve this issue?Hi,
Please check if this applies:
http://support.microsoft.com/kb/2528942
Regards,
Steve Fan
TechNet Community Support
It's recommended to download and install
Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
programs. -
Cannot open Word File because "there are problems with the contents"
Hi Everyone,
I cannot open Word File because "there are problems with the contents" unspecified error; Location: 2. Please help as I need this doc for work meeting this morning. Nothing special about this doc but links were copied into it??? However I do that all the time. I have never had this happen before. I am on a 2010 machine. I just ran a disk permissions repaired and emptied the trash but still no dice. I had several other word docs up as well when I got up this morning but they are all fine. I do not have Time Capsule turned on (which I need to do but that will be another thread/question).
Thank you,
sbOk, I found a way to open this but not sure what happened to begin with and the formatting setup is different now, almost like text editor? Not sure what happened here but hope it doesn't happen again?
-
Hi, I rented a movie in Apple TV, i Have tried to watch it several times but it says there is a problem downloading the content, my movie expires in few days, what can i do to fix this?
Hello chipotles
If the rental is not working, then follow the steps in this article to report an issue with your purchase. And then after that try the to rent the movie again.
How to report an issue with your iTunes Store, App Store, Mac App Store, or iBookstore purchase
http://support.apple.com/kb/HT1933
Thanks for using Apple Support Communities.
Regards,
-Norm G.
Maybe you are looking for
-
How can i transfer my iTunes account to my new mac from my old pc
I have an iPod classic and my itunes account was on my old pc. How do I transfer my account to my Mac and sync my iPod without loosing all my playlists?
-
Page Properties Locked by Template
I am getting this error when I click on the Page Properties button: "All of this page's properties are locked by a template, so you can't edit them." When I look at the template in Dreamweaver they don't appear to be locked and when I compare the tem
-
Can't reply or forward gmail in Mail 6.0 (only write!)
After having done some SMTP-server editing on my MacBook Pro I have problems with Mail 6.0 using Mountain Lion. I've 4 accounts connected to the application of which 2 are gmail accounts with IMAP. The problem is that after the editing I can't reply
-
Execution date in Excel export from a query
Dear all, I am wondering if it is possible to have the query execution date in an exported excel. Case: When working in a query it should be possible to export the query to excel. However I am missing the execution date of the query and the last succ
-
hi all my code is given below:: data: zlv_netpr type netpr, zlv_netwr type netwr, zlv_diff type netpr, Loop at TABLE in_tab. case in_tab-name. when 'ITAB-NETPR'. MOVE in_tab-value TO zlv_netpr. " HERE I AM G