SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Senior Member
    Join Date
    Sep 2008
    Posts
    108
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Validate reply from web service

    Hi

    Sorry if this is basic but I have been through the help and cant quite find what I need.

    I am testing a basic web service which validates credit card numbers. I pass in a card type and number and expect a VALID message back if it is ok.
    The problem is that after setting up the web service and check point and running the script, I get an error.

    The generated script code =
    Sub Main
    'Pass in card data
    Call WebServices.CCValidate.CCValidate("VISA", "4444333322221111")
    If (Not XML.CCValidate.Compare(WebServices.CCValidate)) Then
    Call Log.Error("The CCValidate method of the CCValidate web service returned an incorrect value.")
    End If
    End Sub

    [The card is an industry test Visa card].

    I have followed the steps to create an XML checkpoint as well as the Webservice.

    The result I get =
    'Warning' - The specified XML document differs from the stored document.
    'Pass '- XML Comparison Results [CCValidate]
    'Fail' - The CCValidate method of the CCValidate web service returned an incorrect value.

    I'm not sure why I get a pass and a fail!

    All I need is to see a VALID return to know its ok, and it cannot be that hard, so can someone please tell me what I am missing?

    Thanks

    Steve

  2. #2
    Senior Member
    Join Date
    Jul 2008
    Posts
    1,049
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Validate reply from web service

    Hi Steve,

    If you need to suppress the default message posted by TestComplete when the XMLCheckpoint.Compare method is called, you need to use the following code:

    <font class="small">Code:</font><hr /><pre>
    If (Not XML.CCValidate.Compare(WebServices.CCValidate, False, lmNone)) Then
    Call Log.Error("The CCValidate method of the CCValidate web service returned an incorrect value.")
    End If
    </pre><hr />

    Please see the "XMLCheckpoint.Compare" help topic for more information.
    Regards,
    Allen - SmartBear Support

  3. #3
    Senior Member
    Join Date
    Sep 2008
    Posts
    108
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Validate reply from web service

    Allen

    Thanks for this - I tried but got a VB run time error:
    Wrong number of arguments or invalid property assignment: 'XMLCheckpoint.Compare'

    Steve

  4. #4
    Senior Member
    Join Date
    Sep 2008
    Posts
    108
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Validate reply from web service

    On the back of this, if I want to just ignore one part of the XML, how would I do this?

    I only need to check 2 of the 3 values returned - CCValidStatus &amp; ServiceError. I dont need ServiceErrorDescription.

    In the CCValidate store, this is the line in the Source view:

    &lt;ns1:ServiceErrorDescription xsi:type="xsd:string"&gt;[Autogenerated]&lt;/ns1:ServiceErrorDescription&gt;

    Is it possible to ignore this?

    Thanks

  5. #5
    Senior Member
    Join Date
    May 2004
    Posts
    1,196
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Validate reply from web service

    Hi Steve,

    I was unable to reproduce the problem on our side. Please try specifying 0 instead of lmNone as the method's third parameter. If this suggestion does not help, please zip your entire project suite folder along with the log of the failed test execution and send us the archive via our Contact Support form (http://www.automatedqa.com/support/message.asp). Make sure that messages in your log correspond to valid code lines in the latest version of your scripts.
    Best regards,
    David - SmartBear Support

  6. #6
    Senior Member
    Join Date
    Jul 2008
    Posts
    1,049
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Validate reply from web service

    Hi Steve,

    You can use the "Compare in subtree mode" option to ignore some parts of your XML data (see the "Using XMLCheckpoint Elements to Verify XML Documents" help topic for more information).
    Regards,
    Allen - SmartBear Support

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 06:37 AM.

Copyright BetaSoft Inc.