Results 1 to 3 of 3
  1. #1

    Using IXMLDOMDocument Object

    Hi their I am trying to use IXMLDOMDocument Object to whcih contains SOAP Responses inorder to catch an attribute, but I am unable catch the attribute can any one help me please...

    below is the code

    function GeneralEvents_OnLoadTestingResponse(Sender, User, Request)
    var Doc, Elem;

    // Check the request type and action
    if( (Request["RequestID"] == 8) && (Request["SOAPRequest"]["SOAPAction"] == "\"http://alogent.com/webservices/xpedite/AuthenticateString\""))
    // Get the IXMLDOMDocument object that contains the SOAP response data
    Doc = Request["SOAPResponse"]["DOMBody"];
    Doc = Doc["documentElement"];


    // Check if the element was found
    if (Elem != null)
    if (Elem["getAttribute"]("sessionToken") != null)
    Log["Warning"]("sessionToken not found");
    Log["Error"]("Element 'AuthenticationCompositeResult' was not found.");


    Note: When I am executing the scrip I am getting Error message "Element 'AuthenicationCompositeResult' was not found."

  2. #2

    Re: Using IXMLDOMDocument Object

    Well, I'm not too well versed in that code language but I think the problem is here

    <font class="small">Code:</font><hr /><pre>
    Doc = Request["SOAPResponse"]["DOMBody"];
    Doc = Doc["documentElement"];
    </pre><hr />

    You're assigning doc to the document element after assigning it to the DOM. But later in your code you're calling Elem.

    Change that second line in the code block to

    Elem = Doc["documentElement"];

    and, from what I can see, that SHOULD fix it.
    -Robert Martin
    Automated Testing Evangelists
    TestComplete "expert"
    Definition expert - noun - Unknown drip under pressure

  3. #3

    Re: Using IXMLDOMDocument Object

    Thanks for help Rober,

    I tried in that way but it was not working, so modified my code as below and it working fine

    if( (Request["RequestID"] == 2) &amp;&amp; (Request["SOAPRequest"]["SOAPAction"] == "\"http://alogent.com/webservices/xpedite/AuthenticateString\""))
    // Get the IXMLDOMDocument object that contains the SOAP response data
    //Storing the SOAP response into MainDoc
    MainDoc = Request["SOAPResponse"]["DOMBody"];
    Doc = MainDoc["documentElement"];

    //Loading actual XML to MainDoc
    Doc = MainDoc["documentElement"];
    //storing sessionToken to Elem
    Elem = Doc["getAttribute"]("sessionToken");



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 03:31 PM.

Copyright BetaSoft Inc.