Creates an object regarding to the type of the message.
Returns either an HttpRequest or HttpResponse object on success, or NULL on failure.
Throws HttpRuntimeException, HttpMessageTypeException, HttpHeaderException.