xml - how to extract wsse BinarySecurityToken using PL/SQL -


how can extract binarysecuritytoken following soap payload using pl/sql ?

<wsse:security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">    <wsse:binarysecuritytoken valuetype="string" encodingtype="wsse:base64binary">expectedtoken</wsse:binarysecuritytoken> </wsse:security> 

i expect extract "expectedtoken" result

thanks

you don't neex pl/sql; can use xquery in plain sql:

select xmlquery('declare namespace wsse = "http://schemas.xmlsoap.org/ws/2002/12/secext"; (::)     /wsse:security/wsse:binarysecuritytoken/text()'   passing xmltype('<wsse:security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">    <wsse:binarysecuritytoken valuetype="string" encodingtype="wsse:base64binary">expectedtoken</wsse:binarysecuritytoken> </wsse:security>')   returning content) dual;  xmlquery('declarenamespacewsse="http://schemas.xmlsoap.org/ws/2002/12/secext";(: -------------------------------------------------------------------------------- expectedtoken 

if you're getting response in pl/sql , want continue using it, if soap value in string variable do:

set serveroutput on declare   soap varchar2(500);   token varchar2(200); begin   soap := '<wsse:security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">    <wsse:binarysecuritytoken valuetype="string" encodingtype="wsse:base64binary">expectedtoken</wsse:binarysecuritytoken> </wsse:security>';    select xmlquery('declare namespace wsse = "http://schemas.xmlsoap.org/ws/2002/12/secext"; (::)     /wsse:security/wsse:binarysecuritytoken/text()'   passing xmltype(soap)   returning content).getstringval()   token   dual;     dbms_output.put_line(token); end; /  pl/sql procedure completed.  expectedtoken 

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -