Skip to content

x.0. Workflow XML description

AnthonyMullerPlayground edited this page Oct 24, 2014 · 1 revision

Important - To understand how to use Azot, you require to have basic knowledge about HTTP protocol: (http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol)

Syntax

This sample show how to do a workflow with a single HTTP call. This call will use the "GET" HTTP method (other methods are PUT, POST, DELETE, ...).

You can see too how to provide a HTTP header in the HTTP request. Here, a header named "Accept" indicates that any content type is supported by the client (Azot).

<workflow name="My_First_Workflow">
    <call name="Get_a_book_description">
        <request method="GET" url="http://myserver:8080/api/books/1234" >
             <header name="Accept" value="application/xml" />
        </request>
    </call>
</workflow>

HTTP Headers

You can of course provides HTTP headers when sending a request:

...
<request method="GET" url="http://myserver:8080/api/books" >
    <header name="Accept" value="*/*" />
    <header name="Header1" value="Value1" />
    <header name="Header2" value="Value2" />
</request>
...

Query parameters

You can provide query parameters in this way ('&' must be url-encoded due to XML syntax):

...
<request method="GET" url="http://myserver:8080/api/books?param1=value1&amp;param2=value2" />
...

Sending data to server

To send data to web server with the HTTP request, you can add a section:

...
<call name="Login">
    <request url="http://myserver:8080/api/logon" method="POST">
        <header name="Content-Type" value="application/xml" />
        <header name="Accept" value="application/xml" />
        <content>
        <![CDATA[
        <credentials>
            <login>AnthonyMULLER</login>
            <password>MyGreatPassword</password>
        </credentials>
        ]]>
        </content>
    </request>
</call>
...

XML Syntax - The content must be inserted into a section.

XML Syntax - Special characters provided in URL like & must be URLencoded & amp; due to XML syntax rules. url="http://myserver:8080/api/books?first=hello& amp;second=world"