IT Process Automation

 View Only
Expand all | Collapse all

Question about XPath expressions in strip XML NameSpaces from Response (SOAP Operator - Call Results)

  • 1.  Question about XPath expressions in strip XML NameSpaces from Response (SOAP Operator - Call Results)

    Broadcom Employee
    Posted Apr 27, 2015 06:14 PM


    Hi,

     

    I'm working with SOAP response about ITCM Web Services (Invoke ITCM Web Service), XML response has the following structure.

     

    <GetSoftwareJobsResponse xmlns="urn://www.ca.com/Unicenter/DSM/r11">

    <GetSoftwareJobsReturn>

      <softwareJobPropertiesArray>

       <softwareJobId>1660968252CF4997AD11F62E0FBC552D</softwareJobId>

       <softwareJobName>DummyPackage 1.0:Install</softwareJobName>

       <softwarePackageId>A764DB72C9B64211997AD2883628FEED</softwarePackageId>

       <softwarePackageName>DummyPackage</softwarePackageName>

       <softwarePackageVersion>1.0</softwarePackageVersion>

       <softwarePackageType>SOFTWARE</softwarePackageType>

       <softwarePackageProcedureId>D7FA41BA28274FEBB1A2A6E0EDA8E7E3</softwarePackageProcedureId>

       <softwarePackageProcedureName>Install</softwarePackageProcedureName>

       <executionDate>

       <year>2015</year>

       <month>4</month>

       <dayOfMonth>17</dayOfMonth>

       <hour>16</hour>

       <minute>24</minute>

       </executionDate>

       <createdDate>

       <year>2015</year>

       <month>4</month>

       <dayOfMonth>17</dayOfMonth>

       <hour>16</hour>

       <minute>24</minute>

       </createdDate>

       <timeoutHours>0</timeoutHours>

       <softwareJobType>MANDATORY</softwareJobType>

       <softwareJobState>DSM-ERROR</softwareJobState>

       <startWhen>BOOT-LOCAL-TIME</startWhen>

       <permissionMask xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>

       <bootBeforeMask xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>

       <bootAfterMask xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>

       <operationMask xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>

       <jobStatusCounters>

       <waiting>0</waiting>

       <active>0</active>

       <ok>0</ok>

       <failed>1</failed>

       </jobStatusCounters>

       <internalMask>0</internalMask>

       <orderNumber>0</orderNumber>

       <promptTimeoutHours>0</promptTimeoutHours>

       <softwareJobTask>NONE</softwareJobTask>

       <deliveryDate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>

       <cause>0</cause>

       <renewState>WAITING</renewState>

      </softwareJobPropertiesArray>

      <softwareJobPropertiesArray>

    .

    .

    .

    </GetSoftwareJobsReturn>

    </GetSoftwareJobsResponse>

     

    I can parse xml tags no nested as "softwareJobId" to Process String Array Variable using expression "//softwareJobId", but when I try for date XML marked in red above is not parsing. I'm using XPATH expression "executionDate//year" and I try with Process String Array and Process Int Array, in both cases opertator finish OK but varaible is empty.

    I don't know what I'm doing wrong.

    Anybody could you help me?

     

    Thanks in advance,

    Rafa 



  • 2.  Re: Question about XPath expressions in strip XML NameSpaces from Response (SOAP Operator - Call Results)
    Best Answer

    Posted Apr 27, 2015 07:12 PM

    Hi Rafael_Anoto,

    Try to split the xpath, getting first the ExecutionDate, after the Year.

    But using //executionDate/year, you will have the result of year.

     

    Something that will help you its the following link:

    Free Online XPath Tester / Evaluator - FreeFormatter.com

    In this site, you will able to test you query.

     

    Best regards,

    Douglas Lima



  • 3.  Re: Question about XPath expressions in strip XML NameSpaces from Response (SOAP Operator - Call Results)

    Broadcom Employee
    Posted Apr 28, 2015 06:52 AM

    Hi Douglas,

     

    Great your expression works ok. I have followed expresion syntax specified in XPath Syntax in www.w3schools.com.

    Thanks for your response.

    Rafa