Recording a script: Client javascript posting to webservice

Forum for users of ANTS web server load testing tool

Moderator: Brian Donahue

Recording a script: Client javascript posting to webservice

Postby davidb » Tue May 30, 2006 3:57 pm

Hello.

Firstly forgive me if this question has been asked before.

Our web site has a page which takes in user input (It is classic ASP) and then posts that information to a web service. It does this by building up an XML string of SOAP and then POSTs this back to the server in a client-side javascript routine.

When I record a script it seems to create some of the XML but appears as if a large chunk (indeed the main body of data seems to be missing) of data is missing.

I read somewhere else in another post that it is preferable to try and add a web-reference and use the dot net code to call the web service methods rather than through AddPostData? For one thing when I try and add a web reference to the service I get an error "Unable to create proxy wrapper for this web service" :(

Is there a way to call the web service using AddPostData?
davidb
 
Posts: 2
Joined: Tue May 30, 2006 10:51 am
Location: Blackburn, Lancashire

Postby Brian Donahue » Thu Jun 08, 2006 7:20 pm

Hello,

You can use the script recorder way to call a web service, but you would need to configure it so that you can invoke the webservice from a web page by clicking an 'invoke' button or something like that. A lot of the Microsoft webservice examples are like this. There is something in the configuration that enables it.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby davidb » Fri Jun 09, 2006 9:58 am

Whatl we're trying to achieve is emulating an admin user creating a "sub division" user and running it as 100 concurrent users to see if there's any impact on the site. When this script is running we'll then log on through the web and navigate around the site, also creating "sub users" to make sure that the web site is still usable (i.e. not running very slow).

Recording a script would not allow the soap request to go through, the xml produced was "cut short". When run as a recorded script the "sub division" user was not created.

Anyway I finally managed to get the web service running and now I have a State Information script with the data required which the ANTS scripts uses and passes to the web service thus emulating the web user clicking on the "Add" button. Running it like this works :)

The part of our web site we are testing has only recently been introduced so this will be a good test for it.

I read somewhere that the standard Record would not cope with soap requests. The functionality here is client-side which creates an XML string of SOAP and does it all with AJAX.

Many thanks,
David Baxter.
davidb
 
Posts: 2
Joined: Tue May 30, 2006 10:51 am
Location: Blackburn, Lancashire

Postby Brian Donahue » Fri Jun 09, 2006 6:06 pm

Hello David,

Yes, the SOAP/XMLHTTP/AJAX thing is being looked into as we speak, as fate would have it.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am


Return to ANTS Load

Who is online

Users browsing this forum: No registered users and 0 guests