xml


Extract body of soap response


<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<si xmlns="http://tempuri.org">LOCALE=,USERID=</si>
</soap:Header>
<soap:Body>
<ns2:data xmlns:ns2="http://service/">
<return>
<id>10010</id>
<approvementDate>16.06.2011 - 17:02:08</approvementDate>
<currentYear>2010</currentYear>
<resultCode>Success</resultCode>
</return>
</ns2:data>
</soap:Body>
</soap:Envelope>
I need to extract the body node of the xml by using plsql ,below code works fine for Header
extract('/soap:Envelope/soap:Header/child::node()','xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"');
but I could not get the body by this code
extract('/soap:Envelope/soap:Header/soap:Body/child::node()','xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"');
Thank you for any help.
Body and Header are both direct descendant of the root node. You are trying to get a Body node under a Header node.There is no such child node of Header, so you get no result.
The path should be:
extract('/soap:Envelope/soap:Body/child::node()','xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"');
which as part of a PL/SQL block (with made-up table, column and variable names) would get:
declare
l_doc xmltype;
l_body xmltype;
begin
select xml_col into l_doc from your_table;
l_body := l_doc.extract('/soap:Envelope/soap:Body/child::node()',
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"');
dbms_output.put_line(l_body.getstringval);
end;
/
PL/SQL procedure successfully completed.
<ns2:data xmlns:ns2="http://service/">
<return>
<id>10010</id>
<approvementDate>16.06.2011 - 17:02:08</approvementDate>
<currentYear>2010</currentYear>
<resultCode>Success</resultCode>
</return>
</ns2:data>

Related Links

split a string based on a mapping - xslt
XML formatting Indentation Tags Matching - Linux
How to view xsl output in browsers?
Using a combination of databases/datasources in an application
How can I print large XML string generated by Oracle?
Change xml namespace in root element
SSIS transform rows to columns from xml
rearranging of XML elements and extracting relevant data from its values
XML Interpreter
XML UTF-8 encoding what is the correct way to represent the non-ascii data
XLINQ: string vs Convert.ToString() when extracting element values
Scala, combining filters on XML node
XML digital signature - wrongly computed digest
Zoho API inserRecord using Curl and XML, not returning an error and not adding the “Potential”
Magento - Move cart dropdown plugin to top.links. Reference name=“top.Links” not changing location
Read an include file using XSL

Categories

HOME
django
linkedin
android-studio-2.2
character-encoding
opendj
mips
emscripten
azure-container-service
jtextpane
vert.x
sendgrid-api-v3
32bit-64bit
vimdiff
fhir
distribution
plist
filechannel
qsqlquery
docx
alpacajs
mvc-mini-profiler
forgot-password
nim
database-connection
sar
ag
libigl
google-api-client
onload
syntax-highlighting
oculus
8051
tpm
ceylon
openmdao
scrollview
anki
kudu
clickjacking
contacts
openwhisk
browser-extension
engine.io
apic
parse-tree
lint
zoomify
flatmap
android-augmented-reality
ods
apns-php
setup.py
subclipse
install.packages
android-checkbox
optimizely
plan-9
mesosphere
dotnet-httpclient
launchctl
google-cse
remedy
custom-font
er-diagram
taocp
smartfoxserver
docpad
cudd
ziparchive
seek
jodd
hclust
tooleap
xdoclet
cda
redis-cluster
cortex-m
exim4
vhosts
concurrentmodification
oracle-spatial
extjs-grid
sapscript
finalbuilder
atoi
wso2greg
avahi
telepat
snackbar
bufferedinputstream
procedural-programming
pseudo-class
appserver
psr-4
gii
unix-socket
grails-domain-class
ray
dsym
menubar
android-usb
hibernate-entitymanager
abstract-data-type
epiceditor
android-icons
predicatebuilder
gobject-introspection
entitydatasource
xui
appledoc
socketserver
photolibrary
opml
cldc

Resources

Encrypt Message