Previous Page Arrow Next Page Arrow

11.4 Synchronous Operations

You can start the computeSimplePrice operation, described in the previous section, with the following POST request:

POST /sdata/myApp/myContract/-/products/$service/computeSimplePrice
Content-Type: application/atom+xml; type=entry
 
<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
  <id>http://www.example.com/sdata/myApp/myContract/-/products/$service/computeSimplePrice</id>
  <sdata:payload>
    <productComputeSimplePrice xmlns="http://schemas.sage.com/myContract">
      <request>
        <productID>P049</productID>
        <customerID>C027</customerID>
        <quantity>5.0</quantity>
      </request>
    </productComputeSimplePrice>
  </sdata:payload>
</entry>

If the operation is successful, the server sends the following response:

200 OK
Content-Type: application/atom+xml; type=entry
 
<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
  <id>http://www.example.com/sdata/myApp/myContract/-/products/$service/computeSimplePrice</id>
  <title type="text">computeSimplePrice</title>
  <updated>2008-03-31T14:52:28Z</updated>

  <link rel="http://schemas.sage.com/sdata/link-relations/schema" 
        type="application/xml" title="Schema" 
        href="http://www.example.com/sdata/myApp/myContract/-/$schema?version=5#productComputeSimplePrice" />
  <link rel="http://schemas.sage.com/sdata/link-relations/service" 
        type="application/atom+xml; type=feed" title="Service" 
        href="http://www.example.com/sdata/myApp/myContract/-/products/$service" />

  <category scheme="http://schemas.sage.com/sdata/categories" 
            term="response" label="Response"/>

  <sdata:payload>
    <productComputeSimplePrice xmlns="http://schemas.sage.com/myContract">
      <response>
        <unitPrice>120.0</unitPrice>
        <quantityPrice>600.0</quantityPrice>
        <discount>0.0</discount>
        <tax>33.0</tax>
      </response>
    </productComputeSimplePrice>  
  </sdata:payload>
</entry>
SData providers and consumers MUST use the above protocol to invoke service operations synchronously.

Previous Page Arrow Next Page Arrow