Skip to content

Overview

Concepts and Principles

Development

Overview

IDEs

API Explorer

Releases

Release Notes

TORO Integrate

Coder Studio

Coder Cloud

Bug Reports

Search

Gloop API (REST/SOAP)

This example demonstrates how to expose a Gloop service as a REST or SOAP endpoint. You can find the examples in code/apis/restApi/HelloYou.api and code/apis/soapApi/HelloYouSOAP.api for REST and SOAP respectively. Both APIs use the HelloYouService Gloop service found in code/HelloYouService.gloop.

To test the REST endpoint, send a GET request to /api/sample/hello/<name>.

GET /api/sample/hello/Togo

1
curl http://localhost:8080/api/sample/hello/Togo

Response of GET /api/sample/hello/Togo

1
2
<?xml version="1.0"?>
<response>Hello Togo</response>

To test the SOAP endpoint, send a POST request to /soap/apis.soapApi.HelloYouSOAP.

POST /soap/apis.soapApi.HelloYouSOAP

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
curl -X POST http://localhost:8080/soap/apis.soapApi.HelloYouSOAP \
-H 'Content-Type: application/xml' \
-H 'SOAPAction: HelloYouService' \
-d '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:v1="http://schemas.conversesolutions.com/xsd/dmticta/v1">
<soapenv:Header/>
    <soapenv:Body>
        <HelloYouService>
            <name>Togo</name>
        </HelloYouService>
    </soapenv:Body>
</soapenv:Envelope>'

Response of POST /soap/apis.soapApi.HelloYouSOAP

1
2
3
4
5
6
7
8
<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
        <HelloYouServiceOutput>
            <response>Hello Togo</response>
        </HelloYouServiceOutput>
    </soapenv:Body>
</soapenv:Envelope>