4.2.2 Subsequent Context Participating Messages Using HTTP

After the context is established as described in section 4.2.1, the client sends HTTP messages [RFC2616] that are intended to manipulate the associated shopping cart. All these messages are Context Participating Messages with an HTTP Client Message Header that is isomorphic to the client’s stored context identifier, as shown in the following example.

 POST /ShoppingCart/AddItem HTTP/1.1
 Content-Type: application/xml; charset=utf-8
 Cookie: WscContext="77u/PENvbnRleHQgeG1sbnM9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc
 Host: machine2.example.org
 Content-Length: 80
 Expect: 100-continue
 <AddItem xmlns="http://machine1.example.org/Sample"><item>scarf</item></AddItem>

When the server receives each message, it creates a context identifier that is isomorphic to the HTTP Client Message Header and invokes a business logic function according to its rules for processing HTTP messages. This function determines that a shopping cart exists for the provided context identifier and performs the appropriate action on the shopping cart based on the content of the HTTP message.

The client then closes the connection to the server.