I am new to VS2005 and would like to create a load test for our webservice. The webservice must be able to handle simultaneous connections.
I followed the steps detailed in:
http://msdn2.microsoft.com/en-us/library/ms182557.aspx
as a start, but I am missing the connection to move further.

How To: Simple Steps to create a Webservice Load test
PETRU ROTARIU
jburgess101
The query string specifies the operation to be called.
To find the name / value of the query string parameter:
1. Enter the url to you *asmx page in the browser and press "enter"
2. Click on the operation you want to test on page. This will launch a new page.
On that page, the operation is appended to end of the url.
For example, if the url is http://server/website/add.asmx op=AddNumbers,
in you web service request, the name of the query string parameter should be op, and value should be AddNumbers.
Thank.
hasdkljakldjs
I am connected through our internal network to the server housing the webservice. If I remote into the Server and bring up web service page, I have the option of entering values and invoking the specific method. I copy n' paste appropriate values in the textbox, click Invoke, and it's successful.
If I use the very same data on my machine, then run the webtest, it fails with error 400 Bad Request. Are there any issues with the webtest running over a internal network Any settings I am missing
Thank you
Jaylach
What you want to do is put the values in the datasource, your csv file that you want to replace. Then you would replace the string value in the webservice xml with the value that is added to the web test context by the data source. This value looks something like DataSource1.csvfileName.ColumnName. So you would set your xml to the following. Th {{...}} tells the engine to pull the value from the context.
< xml version="1.0" encoding="utf-8" >
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<UpdateDeviceDataStream xmlns="http://tempuri.org/">
<deviceDataStream>{{DataSource1.csvfileName.ColumnName}}</deviceDataStream>
<Status>boolean</Status>
<DeviceID>string</DeviceID>
</UpdateDeviceDataStream>
</soap:Body>
</soap:Envelope>
The easiest way tp see exactly what should be in the {{ }} is to create a reqular webtest, add the same datasource and bind the column to a query string parameter. This way you can get the exact value that needs to be in the {{...}}
Does this help
Carmen Cerino
Alright, it has been a few weeks... The Goal here is to add the webtest i'm creating to a load test.
So, I have created a new project, C# webtest. In the webtest I am referencing an existing webservice. I have three methods I am testing. Two of them do not require any data.
The third, however, I need to provide a dataset populated from reading in an XML file (or something), a device Id (50char unique id), and boolean. Here is what XML from the webservice looks like:
< xml version="1.0" encoding="utf-8" >
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<UpdateDeviceDataStream xmlns="http://tempuri.org/">
<deviceDataStream>string</deviceDataStream>
<Status>boolean</Status>
<DeviceID>string</DeviceID>
</UpdateDeviceDataStream>
</soap:Body>
</soap:Envelope>
What I would like to do is replace the String for <updatedevicestream> with a variable. This variable (in the load test) would be different for each request or send
I noticed in the webtest I have the option of converting the webtest to code. In the code view however I am missing some Using statements. In particular the Using System.Data.
What would be the best way to insert a variable which would pull unique data for each send in the load test, either from a method somewhere, or a database.
Thanks in advance..
Jitender Rawat
Yes, thank you, it was very helpful. One more question. Even though the webservice is listing "String" for <DeviceDataStream>, what we are sending programatically is XML transformed to a dataset.
When I am creating the data source file, Comma delimited (for instance), do I just use the XML in quotes Or how would that look as a string... do I just write the dataset to String (probably a novice question)
Thank you
Mr. Floca
Alright, QueryString Parameters. Does this represent the "replace with real data" that needs to be included within the XML in the String Body
Thank you
CheeseBob
Mark Burrell
Thank you for responding.
Please let me know if I have this straight:
I can create a web test. Then create a load test, and add my webtest to the load test
Secondly, while creating the webtest there are 5 methods in the webservice I need to test. Can I add all to 1 webtest simply by inserting a web service request for each
advent.children
Alright, the webservice is looking for a "string". I replace "string" with a datasource column value. In particular XML written ToString(). So the statement I used was oXmlDocument.InnerXml.ToString();
This was written to a comma delimited file.
When I bind this data to the "string" field in the webservice call
< xml version="1.0" encoding="utf-8" >
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<UpdateDeviceDataStream xmlns="http://tempuri.org/">
<deviceDataStream>{{DataSource1.Input#csv.DataStream}}</deviceDataStream>
It is failing with an error 400 Bad Request. This error refers to syntax, but is traced down to the ( < > ) characters of the string XML.
Any Ideas I have tried wrapping the DataStream value in quotes, single quotes....
Seref
Create a data source containing the the data you want to use as a substitute. There are lot of options here but let's just assume you create a text file with comma separated values (in this case you would have three items per row corresponding to the three items you want to substibute). The first row of the .csv should be a comma separated list of column names for the three columns in this file (let's assume you called them col1,col2,col3). Let's assume this file is called input.csv.
Create a data source in the web test for input.csv (you'll need to search the documentation for an example of adding a .csv as a web test data source). Let's assume this data source is named dataSource1.
Now replace "string" in the XML above with "{{dataSource1.input#csv.col1}}" (without the quotes). The format of this string is <datasourcename>.<tableName>.<columnName>.
Now when you run this, the values from the csv will be substituted for the data binding markers in the XML. Each successive run of the test will use a different row in the csv.
Again, the data source doesn't have to be a .csv, I just used that as an example.
Does this help
Thanks,
Rick
ozakiweb
The following link takes you to a page which has a number of help links for creating a load test. Please let me know if there is more specific help that you need.
http://msdn2.microsoft.com/en-us/library/ms182571.aspx
VIJAYMODI_81
Richard G.H.Lin
Here is the link that walks you through adding a .csv file as a datasource.
http://msdn2.microsoft.com/en-us/ms404669.aspx
I did have success creating the file. I read a sample XML file into a XmlDocument, then used XPath http://www.codeproject.com/soap/myXPath.asp to update nodes of the document with Unique data.
I used StringBuilder to build a random number/letter combination to replace the selected nodes innerText. Then I used a StreamWriter to write each complete XmlDocument as I looped 1000 times.
Thank you for your help. I will post any other helpful info I find out.