SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Apr 2003
    Location
    Fullerton, CA, USA
    Posts
    87
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Testing Webservices, XML Files

    Hello

    There are couple of xml files that I want to load test for.
    I have put the xml file as a character string in the file.
    Now how do I pass that xml file as a submit call to a particular url and retrieve the xml output back?

    I tried using web_custom_request or web_submit_data but am not able to succeed in the same.

    Also once the xml file is returned back as an server output, I need to query that xml file and retrieve some specific data.

    I know we can use the lr_xml_get_values and related methods to query the xml file and all but in this case the xml is returned back as the server output.
    I am sure how should I tackle the same.

    Any help is appreciated.

    Thanks mh

  2. #2
    Junior Member
    Join Date
    Dec 2004
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Testing Webservices, XML Files

    I just had to do this, here is the code with params inserted
    </font>
    1. <font size="2" face="Verdana, Arial, Helvetica">QAURL = the http://host.domain.name/dir/servlet</font>
    2. <font size="2" face="Verdana, Arial, Helvetica">XML = the xml you want to post, a string properly formatted, what not</font>
    <font size="2" face="Verdana, Arial, Helvetica"></font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">SubmitTrans()
    {
    int i, numRatings;
    char buf[64];

    lr_start_transaction(&quot;Submit_Transaction&quot;
    web_reg_save_param(&quot;XMLReturn&quot;, &quot;LB=&quot;, &quot;RB=&quot;, &quot;Search=body&quot;, LAST);
    web_reg_find(&quot;Text=&lt;ANSWER RequiredItems=&quot;, LAST);
    web_reg_find(&quot;Text=&lt;ERROR&gt;&quot;, &quot;Fail=Found&quot;, LAST);
    web_reg_find(&quot;Text=&lt;WARNING&gt;&quot;, &quot;Fail=Found&quot;, LAST);
    web_custom_request(&quot;post_vs_transaction&quot; ,
    &quot;URL={QAURL}&quot;,
    &quot;Method=POST&quot;,
    &quot;TargetFrame=&quot;,
    &quot;Resource=0&quot;,
    &quot;Referer=&quot;,
    &quot;EncType=text/xml&quot;,
    &quot;Body={XML}&quot;,
    LAST);
    lr_end_transaction(&quot;Submit_Transaction&quot;, LR_AUTO);
    lr_output_message(lr_eval_string(&quot;*** Result: {XMLReturn}&quot);
    lr_xml_get_values(&quot;XML={XMLReturn}&quot;, &quot;ValueParam=number&quot;, &quot;Query=/VERIFY_PACKET/ANSWER/TELEPHONE_NUM_ANS&quot;, LAST);
    lr_output_message(lr_eval_string(&quot;*** Number: {number}&quot);
    lr_xml_find(&quot;XML={XMLReturn}&quot;, &quot;Value=5555555555&quot;, &quot;Query=/VERIFY_PACKET/ANSWER/TELEPHONE_NUM_ANS&quot;, LAST);

    numRatings = lr_xml_extract(&quot;XML={XMLReturn}&quot;, &quot;SelectAll=yes&quot;, &quot;Query=/VERIFY_PACKET/ANSWER/*/@ItemAnswerRating&quot; , &quot;XMLFragmentParam=rating&quot;, LAST);
    for( i=0; i&lt;numRatings; i++) {
    sprintf(buf, &quot;*** Answer Rating %d: {rating_%d}&quot;,i+1, i+1);
    lr_output_message(lr_eval_string(buf));
    }

    return 0;
    }</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">most of this was just stuff i found online and bits i played with to get it working. i did notice that web_reg_finds work just as well as the xml searches.

 

 

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 11.54%
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 04:09 PM.

Copyright BetaSoft Inc.