Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: How to obtain value from SOAP handle response

  1. #1

    Default How to obtain value from SOAP handle response

    Hello everyone,

    I used the "General - Annoted Web Service Call" example from the sample folder to make a soap call and obtain a response.
    Using the example, I can see how particular values are obtained from the body of the soap response.

    However, when I translate it with my particular response, it doesn't seem to work. I'm not very good at SOAP so I'm certainly doing something wrong.

    Here it is:

    This is my call:

    request = <soapenv:Envelope xmlns:soapenv="" xmlnsmi="" xmlnsmit="">

    This is my response:
    <soapenv:Envelope xmlns:soapenv="">
    <ns3:signOnResponse xmlns:ns3="">
    <ns1:handle xmlns:ns1="">h0PtwMXVmHp6Oqy7A6CmcrFrnVM=</ns1:handle>
    <ns1:resultId xmlns:ns1="">admin</ns1:resultId>
    <ns1:resultCode xmlns:ns1="">0</ns1:resultCode>
    <ns1:resultText xmlns:ns1="">Success</ns1:resultText>

    This is the code (pretty much a copy of the sample transformation):
    responseXml = responseXml.replace(/^<\?xml\s+version\s*=\s*(["'])[^\1]+\1[^?]*\?>/, "");
    var response = new XML(responseXml);

    // Determine the namespace of the SOAP Envelope:
    var soap = response.namespace();

    // Specify the namespace of the verify email response:
    var ws = response.*.*.namespace();

    // Set this namespace as a default to make parsing the response easier:

    default xml namespace = ws

    var responseBody = response.soap::Body.signOnResponse;
    var handle = responseBody.signOnResponse.sessionHandle.handle



    The Alert box is empty.

    However if I place in the alert:

    I obtain the following:
    <ns3:signOnResponse xmlns:ns3="" xmlns:soapenv="">
    <ns1:handle xmlns:ns1="">TBdn27dfFPlpWG/HTRgH16LsrkI=</ns1:handle>
    <ns1:resultId xmlns:ns1="">admin</ns1:resultId>
    <ns1:resultCode xmlns:ns1="">0</ns1:resultCode>
    <ns1:resultText xmlns:ns1="">Success</ns1:resultText>

    I just can't get to the handle: TBdn27dfFPlpWG/HTRgH16LsrkI=

    A bit of help would be very helpful.

    Thanks a lot

    There's no point going somewhere if you don't enjoy the ride.

  2. #2
    Join Date
    Jun 2012


    I can't see a SOAP problem here. If you just want to extract the handle from the response, you can use "Get Data from XML" for that - no need for JavaScript.
    So long, and thanks for all the fish.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.