WebServices...output

danishhdanishh Posts: 12
edited October 22, 2004 10:24AM in ANTS Load
Brian,

I'm testing some web services. I want to know how to go about capturing the xml that is returned. For example, the ants tutorial provides a webservice test. There is a specific call:

employeesService.GetEmployeeDetails(employeeID)

how do i capture the xml that is generated by that call. Namely how do I capture (http://localhost/ANTSLoadTutorialWebSer ... yeeDetails) output.

Also, since GetEmployeeDetails only looks for 1 argument its understood tha employeeID will be passed. What happens when a webservice request is looking for multiple args??

Thanks,
Danish.

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi Danish,

    Webservices always return XML, but the webservice consumer in ANTS Load will cast the data as whatever datatype the returned object is supposed to be represented as. In your case, you'd need to get the object back from the webservice and turn it back into XML. Here is an example script, assuming that you have referenced the antsloadtutorialweiservice/employees.asmx:
    Imports System
    Imports RedGate.Ants.Engine
    Imports localhost
    Imports System.Data

    'Automatically generated template code for testing a web service.
    Public Class WebServiceClient1
    Inherits Control.VirtualClient

    Protected Overrides Sub Run()
    'The web service is located at http://localhost/antsloadtutorialwebser ... oyees.asmx

    'Create an instance of the proxy.
    Dim webService As New Employees

    Dim ds As DataSet = webService.GetEmployeeDetails(1)
    Dim XML As String = ds.GetXml()
    Me.LogToFile(XML)
    'Random think time of between 1 and 2 seconds
    RandomSleep(1000, 2000)

    End Sub
    End Class
This discussion has been closed.