Forum Discussion

mohbubur_rahman's avatar
mohbubur_rahman
Contributor
16 years ago

HTTP requests

Hi,

Can you tell me if SoapUI supports HTTP requests, specifically a GET command? If so can you explain how I would do that.

Regards,

Moks

4 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi,

    You'll need to create a groovy-script for this, something in the line of

    // create request
    def getMethod = new org.apache.commons.httpclient.methods.GetMethod( url )

    // get httpclient
    def httpClient = com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport.httpClient

    // send it
    httpClient.executeMethod( getMethod )

    // process response
    def response = getMethod.responseBodyAsString
    ...


    regards,

    /Ole
    eviware.com
  • Thanks Ole, I am new to SoapUI and Groovy scripts, where would be a good starting point for this?
  • Thanks Ole, I was able to perform this action.

    The http request is sent based on the response recieved for a soap request. Based on the time range specified, the response will have n' elements that I require using http request for.

    E.g. If I specify time from 08:00-12:00, this will create 3 elements. I am using Xpath (...\\elementName), this should give me all occurences of this element (not able to prove yet). I need to use th Groovy script to iterate through each of these element and send a http request. I have been able to use while statement. But how would I iterate though the captured property?

    Moks