Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In contrast to importing a WSDL, no service definition is automatically generated, You have to define how the REST service is called manually. Create a new REST service object and give your REST service a name.

Next, you need to specify the location of the REST service. This is an URL. You can already specify fragments and arguments here, but then you cannot change them later. For example, check http://services.faa.gov/airport/status/IAD?format=xml. In this case, airport, status and IAD are dynamic fragments and can change, depending on input by the user. You would only use http://services.faa.gov/ as location in this case.

Now specify the Schema Set that you want to use. Choose the Schema Set that you have imported earlier.

You can specify as many operations as you need, by pressing on the plus icon. Give every operation a unique name.

Request

If you want to dynamically change the address or send custom headers or body in your message, you need to specify a singleton entity from where the information is gathered (1). (2) shows the URL you are going to call. Items within {} are dynamic and determined during runtime. You can add static fragments (3) which are always the same, or dynamic fragments (4) which are filled by attributes of the request entity. You can specify arguments (5) of your request the same way. There exist 4 different HTTP methods: GET, POST, PUT and DELETE. Most likely, the web service works with the GET method. This method does not alter the state of the web service and just asks for information. At (6) you specify what method to use.

You can also send a message to the REST web service as part of the http headers. This happens more often with POST and PUT methods. This procedure is the same as for the response of the message that you find just below here.

Response

Now you can specify how your message looks like. (1) lets you specify what kind of message it is (Get, Post, Put or Delete). If you need to set headers, then you can do so at (2) in the same way you set arguments or fragments earlier. If you need to send information in the body of the message, for example with a Post message, then you can specify this now. This is done in XML, and your Schema needs to be able to handle this. If you have a SimpleType in the schema, then you fill in an attribute at (5). If it is a complexType, then first choose which entity will be send at (3) and then you attribute field (5) will swithc to a relation field. Fill in the name of the relation between your singleton request entity and your data entity. Custom Schema Elements (4) are ways to fill in your schema in a different way other than with data from your profile. It is not needed at the moment.

Now you need to define how you receive data from the REST service. Click on response and you will see a window just like the window in the screenshot above. Fill in the form the same way as explained above.

...