Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.ode.axis2.httpbinding
Class HttpClientHelper

    java.lang.Object
      org.apache.ode.axis2.httpbinding.HttpClientHelper

    public class HttpClientHelper

extends java.lang.Object

Constructor Summary
`HttpClientHelper()`

Method Summary
`static void` | `configure(org.apache.commons.httpclient.HostConfiguration hostConfig, org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.URI targetURI, org.apache.commons.httpclient.params.HttpParams params)`
`static org.w3c.dom.Element` | `prepareDetailsElement(org.apache.commons.httpclient.HttpMethod method)` Build a "details" element that looks like this:
`static org.w3c.dom.Element` | `prepareDetailsElement(org.apache.commons.httpclient.HttpMethod method, boolean bodyIsXml)`
`static java.lang.String` | `replaceCRLFwithLWS(java.lang.String header)` This method ensures that a header value containing CRLF does not mess up the HTTP request.
`static org.w3c.dom.Element` | `statusLineToElement(org.w3c.dom.Document doc, org.apache.commons.httpclient.StatusLine statusLine)` Convert a HTTP status line into an xml element like this: < Status-line> < HTTP-Version>HTTP/1.1< /HTTP-Version> < Status-Code>200< /Status-Code> < Reason-Phrase>Success - The action was successfully received, understood, and accepted< /Reason-Phrase> < /Status-line>
`static org.w3c.dom.Element` | `statusLineToElement(org.apache.commons.httpclient.StatusLine statusLine)`
`static org.w3c.dom.Element` | `statusLineToElement(java.lang.String statusLine)` Parse and convert a HTTP status line into an aml element.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### HttpClientHelper

    public HttpClientHelper()

Method Detail

### configure

    public static void configure(org.apache.commons.httpclient.HostConfiguration hostConfig,
                                 org.apache.commons.httpclient.HttpState state,
                                 org.apache.commons.httpclient.URI targetURI,
                                 org.apache.commons.httpclient.params.HttpParams params)
                          throws org.apache.commons.httpclient.URIException

  Throws:
    `org.apache.commons.httpclient.URIException`

### statusLineToElement

    public static org.w3c.dom.Element statusLineToElement(java.lang.String statusLine)
                                                   throws org.apache.commons.httpclient.HttpException

  Parse and convert a HTTP status line into an aml element.

  Parameters:
    `statusLine` -
  Returns:
  Throws:
    `org.apache.commons.httpclient.HttpException`
  See Also:
    `statusLineToElement(org.w3c.dom.Document, org.apache.commons.httpclient.StatusLine)`

### statusLineToElement

    public static org.w3c.dom.Element statusLineToElement(org.apache.commons.httpclient.StatusLine statusLine)

### statusLineToElement

    public static org.w3c.dom.Element statusLineToElement(org.w3c.dom.Document doc,
                                                          org.apache.commons.httpclient.StatusLine statusLine)

  Convert a HTTP status line into an xml element like this:

  < Status-line> < HTTP-Version>HTTP/1.1< /HTTP-Version> < Status-Code>200< /Status-Code> < Reason-Phrase>Success - The action was successfully received, understood, and accepted< /Reason-Phrase> < /Status-line>

  Parameters:
    `statusLine` - - the `StatusLine` instance to be converted
    `doc` - - the document to use to create new nodes
  Returns:
    an Element

### prepareDetailsElement

    public static org.w3c.dom.Element prepareDetailsElement(org.apache.commons.httpclient.HttpMethod method)
                                                     throws java.io.IOException

  Build a "details" element that looks like this:

  Parameters:
    `method` -
  Returns:
  Throws:
    `java.io.IOException`

### prepareDetailsElement

    public static org.w3c.dom.Element prepareDetailsElement(org.apache.commons.httpclient.HttpMethod method,
                                                            boolean bodyIsXml)
                                                     throws java.io.IOException

  Parameters:
    `method` -
    `bodyIsXml` - if true the body will be parsed as xml else the body will be inserted as string
  Returns:
  Throws:
    `java.io.IOException`

### replaceCRLFwithLWS

    public static java.lang.String replaceCRLFwithLWS(java.lang.String header)

  This method ensures that a header value containing CRLF does not mess up the HTTP request. Actually CRLF is the end-of-line marker for headers.

  To do so, all CRLF followed by a non-whitespace character are replaced by CRLF HT.

  This is possible because the Section 2.2 of HTTP standard (RFC2626) states that:

  HTTP/1.1 header field values can be folded onto multiple lines if the continuation line begins with a space or horizontal tab. All linear white space, including folding, has the same semantics as SP. A recipient MAY replace any linear white space with a single SP before interpreting the field value or forwarding the message downstream.

  LWS = [CRLF] 1*( SP | HT )

  FYI, HttpClient 3.x.x does not check this.

  Parameters:
    `header` -
  Returns:
    the string properly ready to be used as an HTTP header field-content

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD