Forum Discussion

DelGreco's avatar
DelGreco
New Contributor
12 years ago

[Resolved] REST Test Request with URL variables

Hello all,

This is my first post here. I have had a look about, and cannot find a solution to my (I thought was simple) query.
(Also sorry if this is in the wrong place)

So, I am testing some web services provided by ASP.NET MVC.

The services are setup so that they are accessible via the following example url request / path:
http://someURL.com/controller/view/{VARIABLE}/Method/{ANOTHER-VARIABLE}

E.g. http://aaaaa.bbbbb.com/api/datamanager/user/5/record/6


For a single variable at the end of the url request, I have been setting up a SOAPUI Request, with a single variable named ID. e.g. simply passing in url?Id=variable, and that works fine.

However, for two variables it does not work. Nor does it work for variables in the middle of the url request.

So, my questions are:
- Is it possible to pass multiple variables as part of the SoapUI Request, as part of the url request / path?
or
- Is this a problem in the way that the web services have been setup?
or
- is this just a limitation of the software?


I've spent a few days trying to find the answer to this question, and there are loads of examples for passing variables, passing coded variables, etc, but nothing which seems to solve my problem.

Hoping someone else has solved an issue like this, and can shed some light on it for me!


Kindest Regards,

DelGreco
  • You would need to define two new parameters with Style TEMPLATE as defined here - http://www.soapui.org/REST-Testing/unde ... parameters:

    1. VARIABLE
    2. ANOTHER-VARIABLE

    Then you can define your Resource of the URI exactly as you have:
    /controller/view/{VARIABLE}/Method/{ANOTHER-VARIABLE}

    That should populate correctly at runtime.

    Thanks,
    Michael Giller
    SmartBear Software
  • DelGreco's avatar
    DelGreco
    New Contributor
    That is great, thankyou.

    I will work through that today and hopefully that will have everything sorted for me.

    Thanks again for your quick help.




    Kindest Regards,

    DelGreco
  • DelGreco's avatar
    DelGreco
    New Contributor
    Just to confirm, that is outstanding!

    Fixed my issue perfectly!

    Many thanks again!

    DelGreco