Recording a script: Client javascript posting to webservice

davidbdavidb Posts: 3
edited June 9, 2006 1:06PM in ANTS Load
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?

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    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.
  • 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.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hello David,

    Yes, the SOAP/XMLHTTP/AJAX thing is being looked into as we speak, as fate would have it.
Sign In or Register to comment.