MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.model.ws
Class HttpMessage

java.lang.Object
  extended by ch.ethz.mxquery.model.ws.HttpMessage
Direct Known Subclasses:
HttpRequest, HttpResponse

public class HttpMessage
extends java.lang.Object

Represents a HTTP message without request or response starting.


Method Summary
 void addAttribute(java.lang.String name, java.lang.String value)
          Adds an attribute to this HTTP message.
 java.lang.String getAttribute(java.lang.String name)
          Gets the value of an HTTP attribute
 java.lang.String getHttpContent()
          Returns the content of this message.
 java.lang.String getHttpMsg()
          Gets this HTTP message as a String
 int getLengthAttributeValue()
          Returns the declared content length (Http Header).
 java.lang.String getSoapBody()
          Gets the SOAP body of the content of this message.
static java.lang.String getSoapBody(java.lang.String soap)
           
 void setHttpContent(java.lang.String httpContent)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAttribute

public java.lang.String getAttribute(java.lang.String name)
Gets the value of an HTTP attribute

Parameters:
name - name of a HTTP attribute
Returns:
null, if the attribute doesn't exist

getLengthAttributeValue

public int getLengthAttributeValue()
Returns the declared content length (Http Header). If the length is not declared, it returns -1.

Returns:
-1 if no length is declared, the length in bytes otherwise

addAttribute

public void addAttribute(java.lang.String name,
                         java.lang.String value)
Adds an attribute to this HTTP message.

Parameters:
name -
value -

getHttpContent

public java.lang.String getHttpContent()
Returns the content of this message.

Returns:
the http payload as string

setHttpContent

public void setHttpContent(java.lang.String httpContent)

getSoapBody

public java.lang.String getSoapBody()
                             throws java.io.IOException
Gets the SOAP body of the content of this message.

Returns:
the SOAP body as string
Throws:
IOException, - if the content doesn't contain SOAP
java.io.IOException

getSoapBody

public static java.lang.String getSoapBody(java.lang.String soap)
                                    throws java.io.IOException
Throws:
java.io.IOException

getHttpMsg

public java.lang.String getHttpMsg()
Gets this HTTP message as a String

Returns:
the full http message as string

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich