Starting from 10.1.86 we introduced a new API called net.http.listen which makes it much simpler to port over web services code implemented in Iguana 6. To try it out do the followingThe built-in Web Service component provides a simple framework for creating a web service endpoint in Iguana to receive and handle HTTP requests.
Follow the steps below to import and try it out in your Iguana:
Expand |
---|
title | STEP 1 - Make sure you GIT cache : Import the Web Service component |
---|
|
Image Added Info |
---|
If you cannot find the Web Service component, make sure your Git Cache is up to date |
| Add Components Close the screen. Wait a few minutes and then you should be able to see everything again. |
|
Expand |
---|
title | STEP 2 - Import the Web Service component |
---|
|
Image Removed |
Expand |
---|
title | STEP 3 - : Run the component |
---|
|
You should see something like this: Image RemovedConfirm you are in Development mode, it will be easier to edit and test your changes! Image Added |
Expand |
---|
title | STEP 4 - 3: Click on the URL Link http://localhost:7777/ and use the interface |
---|
|
|
Expand |
---|
title | STEP 5 - Play with the interface |
---|
|
|
Expand |
---|
title | STEP 6 - Look 4: Now open up the Translator to look at the source code |
---|
|
You Your Translator should see look something like this: Image AddedListens for HTTP requests: If you are coming from Iguana v6, notice line 8. In IguanaX, we introduced a new API called net.http.listen{} which makes it much simpler to port over web services code implemented in Iguana v6. Parses HTTP request: Image RemovedThe data is parsed into an HTTP request object using net.http.parseRequest() . Builds and sends an HTML response: Constructs an HTML response header and body to send back to the client.
|
...
Expand |
---|
title | STEP 7 - 5: Import some sample data |
---|
|
Image Removed The you Try adding your own sample data. You can add different types of sample HTTP requests from the Iguana logs. You should see a screen like this: Image Removed |
Expand |
---|
title | STEP 8 - Click around, alter the code, stop and start it. |
---|
|
It will probably be easier for you to develop the webservice if you are in Development mode. See: Using the DEVELOPMENT Commit |
Image Added This way you can test how your web service handles different types of requests! |