000030104 - Difference between RegEx and XPath

Document created by RSA Customer Support Employee on Jun 14, 2016Last modified by RSA Customer Support Employee on Apr 21, 2017
Version 2Show Document
  • View in full screen mode

Article Content

Article Number000030104
Applies ToRSA Product Set: Identity Management and Governance
RSA Product/Service Type: Appliance
RSA Version/Condition: 6.9.1
Platform: Linux
Platform (Other): null
O/S Version: null
Product Name: null
Product Description: null
IssueDuring an implementation, RegEx is required to be utilized in SOAP node but it fails if the expression used in the response configuration produces a null value, and it would continue to fail no matter what RegEx is used.  A need for expected behavior and details is required for RegEx and XPath.
Resolution

The SOAP web service node functions as below.
There are two methods to extract required value/values from incoming SOAP  envelope.



  1. Regex


 
When RegEx is used, any time the RegEx expression would match only the attribute or the child node with a single node value, it will return the results as shown below. 
For e.g. in given XML if RegEx says match "emplid" then the results would be an array variable with value
 ["1111","2222","3333","4444"]
 
Or
 
 If RegEx says match "email" then results would be an array variable with value
["johnsmith@user.com","johnsmith2@user.com"]
 



  

<Employees>
                <Employee emplid="1111" type="admin">
                    <firstname>John</firstname>
                    <lastname>Smith</lastname>
                    <age>30</age>
                    <email>johnsmith@user.com</email>
                </Employee>
                <Employee emplid="2222" type="admin">
                    <firstname>John</firstname>
                    <lastname>Smith</lastname>
                    <age>32</age>
                    <email>johnsmith2@user.com</email>
                </Employee>
  
            </Employees>


  

 
 
 In given XML if RegEx says match "sys_id" then the results would be user variable with value
sys1234



  

 
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sc="http://www.service-now.com/sc_request">
      <soapenv:Header/>
      <soapenv:Body>
         <sc:insertResponse>
            <!--Optional:-->
            <sc:sys_id>sys1234</sc:sys_id>
            <!--Optional:-->
            <sc:number>1234</sc:number>
         </sc:insertResponse>
      </soapenv:Body>
   </soapenv:Envelope>


  

 



  1. XPath


This accepts an XPath Expression and return the matching Node or NodeList String values. If there is nomatch then it would return NULL to calling function.
 
If "Proceed on failure" option selected. This will set job level variables with failure message and code and continue execution. 

Attachments

    Outcomes