Rest resources and methods in SOAPUI

Source: Internet
Author: User
Tags soapui

1. Add rest services, feeds, and methods

A rest service contains any number of available sources for the appropriate path. The resource itself can have as many child resources as possible, and the child resource path and all parent paths are linked together.

first create a new rest service in your project. Right-click your project in the Navigator and select the rest service for the new URI:

Specify the following URL to the Google Maps API in the New Rest Service dialog box: (  http://maps.googleapis.com/maps/api/geocode /xml?address=rio&sensor=false  )

It automatically populates the resources and methods needed to create the service. Now, we get the following navigation tree:

1 "and" Request request window is open, submit request Green arrow in upper left corner, you will get:

before exploring the rest request Editor, we need forward look at the objects that were generated when you added the rest service. Let's start by double-clicking the created resource, which opens the following window:

in the toolbar you can view and change the path that is mapped to the resource. This is a "Resource parameters" tab, we can see "address" and   " sensor " 

    1. in the build Wadl define the correct parameters (see below)
    2. Span id= "outfox_jtr_trans_node-422" class= "Outfox_jtr_trans_node" >rest The requested editor provides a better input form (see below)
    3. set a parameter value with custom encoding processing ("Disable encoding" setting)

Let's add a nice description for the required parameter settings (as shown above), which will make Wadl last better ( You will see below).

rest the next in the service hierarchy is the Get method that we defined for the resource (highlighted above). You can define any number of methods. With the "New method" option on the resource pop-up menu, when creating the original method will open the same dialog box as above example. Double-click the Open Method's edit window:

top toolbar allows you to change the HTTP method used (GET, POST, PUT, The Delete option support and tracking) and the Method Parameters tab are similar to the Resource Parameters tab we saw above, where the parameters are defined to be used by all methods to create the request.

The method for a particular window is the "Presentation" tab:

Here you can see the representation defined in the method, When we submit our first request in our case, SOAPUI automatically generates a representation for us and will continue to add each unique response content type and status code representation that is received. You can add and remove representations as needed using the toolbar buttons.

Tip: This can also be visible for request/response edits described below.

2. Generate WADL

when defining a rest service "manual" as we did above, SOAPUI automatically generates the corresponding WADL for us. If you now double-click the original rest service we have defined Twitter and selected the Wadl-content tab, you will get:

Rest resources and methods in SOAPUI

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.