The client should submit two XML like documents, the first is the protocol specification one (currently the set of lines of the HTTP query), and one is the query specification (currently the URL options and the form content).
The HTTP server should be able to specify the client: ok, now you listen of the TCP connection, and I will provide you instructions. Then if the client wants to talk to the server, it should open another connection.