Recording a script: Client javascript posting to webservice
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?
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
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.
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.
Yes, the SOAP/XMLHTTP/AJAX thing is being looked into as we speak, as fate would have it.