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
 29mdC5jb20vd3MvMjAwNi8wNS9jb250ZXh0Ij48UHJvcGVydHkgbmFtZT0iaW5zdGFuY2VJZC
 I+ODIxOWQ2NjItYTAzMi00YzA4LWFjZWItNzZiN2ZmYWYzNTAyPC9Qcm9wZXJ0eT48L0NvbnR
 leHQ+"
 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.