Automic Workload Automation

Expand all | Collapse all

Automic 12.2.2 SOAP Webservice XML Parsing

  • 1.  Automic 12.2.2 SOAP Webservice XML Parsing

    Posted 09-17-2020 06:47 PM
    Hi Team,
    I am getting the below XML response. I need to get the highlighted value Pid 173532 from the below XML response. I need Expression (Below automic screen) syntax to get the exact value 173532 from the XML.  



    2020-09-17 14:33:21             SOAP Response
    2020-09-17 14:33:21             Response-Code: 200
    2020-09-17 14:33:21             Content-Type: text/xml;charset=utf-8
    2020-09-17 14:33:21             Transfer-Encoding: chunked
    2020-09-17 14:33:21             Date: Thu, 17 Sep 2020 21:33:20 GMT
    2020-09-17 14:33:21             Set-Cookie: 96b6db70e130181d48cd95ed13fde9aa=110fd272f386476842dbd7d1853be6d1; path=/; HttpOnly; Secure
    2020-09-17 14:33:21             Payload: <tns:Envelope xmlns:tns="http://schemas.xmlsoap.org/soap/envelope/">
    2020-09-17 14:33:21                <tns:Header>
    2020-09-17 14:33:21                   <gwsoap:traceability_id xmlns:gwsoap="http://guidewire.com/ws/soapheaders">?</gwsoap:traceability_id>
    2020-09-17 14:33:21                </tns:Header>
    2020-09-17 14:33:21                <tns:Body>
    2020-09-17 14:33:21                   <startBatchProcessResponse xmlns="http://guidewire.com/ab/ws/gw/webservice/ab/ab1000/MaintenanceToolsAPI">
    2020-09-17 14:33:21                      <return xmlns:pogo="http://guidewire.com/gw/api/tools">
    2020-09-17 14:33:21                         <pogo:Pid>173532</pogo:Pid>
    2020-09-17 14:33:21                      </return>
    2020-09-17 14:33:21                   </startBatchProcessResponse>
    2020-09-17 14:33:21                </tns:Body>
    2020-09-17 14:33:21             </tns:Envelope>
    2020-09-17 14:33:21             --------------------------------------
    2020-09-17 14:33:21             Starting XQuery response script execution.
    2020-09-17 14:33:21             Response script execution done.


  • 2.  RE: Automic 12.2.2 SOAP Webservice XML Parsing

    Posted 09-17-2020 06:50 PM
    I have three types Xpath, XQury, Groovy. Which one would be optimal solution and syntax?


  • 3.  RE: Automic 12.2.2 SOAP Webservice XML Parsing

    Posted 09-18-2020 03:31 AM
    Dearest Prakash

    Long time no see :)
    Have you tried XPath: /tns:Envelope/tns:Body/startBatchProcessResponse/return/pogo:Pid/text()

    Regards

    Sandro

    ------------------------------
    Automation Engineer
    Swisscom
    ------------------------------



  • 4.  RE: Automic 12.2.2 SOAP Webservice XML Parsing

    Posted 09-22-2020 11:38 PM
    Thanks Sandro. Appreciate your response. I will test and let you know.


  • 5.  RE: Automic 12.2.2 SOAP Webservice XML Parsing

    Posted 17 days ago
    Still i am getting below error message. But trying multiple options. Its working through PREP_PROCESS_REPORT. But i want to use Xpath which i feel its optimal solution.
    +++++++++++++++++++++++++++++++++++++ Start of Runtime Exception ++++++++++++++++++++++++++++++++++++
    ch.ethz.mxquery.exceptions.StaticException: Namespace not known



  • 6.  RE: Automic 12.2.2 SOAP Webservice XML Parsing

    Posted 17 days ago
    Edited by Sandro Bucher 17 days ago
    Hi Prakash

    Thought about Automic bug? The above XPath expression is tested and valid => https://www.freeformatter.com/xpath-tester.html

    Regards

    Sandro

    ------------------------------
    Automation Engineer
    Swisscom
    ------------------------------



  • 7.  RE: Automic 12.2.2 SOAP Webservice XML Parsing

    Posted 16 days ago
    Thanks Sandro. We were able to figure out this issue. Below is the modified xpath which worked fine. 
    /Envelope/Body/startBatchProcessResponse/return/string(Pid)


  • 8.  RE: Automic 12.2.2 SOAP Webservice XML Parsing

    Posted 17 days ago
    Hi Prakash,
    try "/Envelope/Body/startBatchProcessResponse/return/Pid/text()"
    it does not work in the xpath formatter Sandro suggested but it does work in the xpath tester in the WEBSERVICEREST REST job.
    so there is a good chance it will work in the SOAP job.
    regards
    Paul



    ------------------------------
    HCL Technologies
    ------------------------------



  • 9.  RE: Automic 12.2.2 SOAP Webservice XML Parsing

    Posted 16 days ago
    Thanks Paul. We were able to figure out this issue. Below is the modified xpath which worked fine. 
    /Envelope/Body/startBatchProcessResponse/return/string(Pid)