org.apache.ode.axis2.httpbinding
Class HttpMethodConverter

java.lang.Object
  extended by org.apache.ode.axis2.httpbinding.HttpMethodConverter

public class HttpMethodConverter
extends java.lang.Object


Field Summary
protected  javax.wsdl.Binding binding
           
protected static Messages msgs
           
 
Constructor Summary
HttpMethodConverter(javax.wsdl.Binding binding)
           
 
Method Summary
 org.apache.commons.httpclient.HttpMethod createHttpRequest(PartnerRoleMessageExchange odeMex, org.apache.commons.httpclient.params.HttpParams params)
           
 org.w3c.dom.Element createPartElement(javax.wsdl.Part part, org.w3c.dom.Element receivedElement)
          Create the element to be associated with this part into the Message.
 org.w3c.dom.Element createPartElement(javax.wsdl.Part part, java.lang.String textContent)
          Create the element to be associated with this part into the Message.
 void extractHttpResponseHeaders(Message odeMessage, org.apache.commons.httpclient.HttpMethod method, javax.wsdl.Message messageDef, javax.wsdl.BindingOutput bindingOutput)
          Process the HTTP Response Headers.
protected  java.util.Map<java.lang.String,org.w3c.dom.Element> extractPartElements(javax.wsdl.Message msgDef, org.w3c.dom.Element message)
           
protected  org.apache.commons.httpclient.HttpMethod prepareHttpMethod(javax.wsdl.BindingOperation opBinding, java.lang.String verb, java.util.Map<java.lang.String,org.w3c.dom.Element> partValues, java.lang.String rootUri, org.apache.commons.httpclient.params.HttpParams params)
          create and initialize the http method.
 void setHttpRequestHeaders(org.apache.commons.httpclient.HttpMethod method, java.util.Map<java.lang.String,org.w3c.dom.Element> partValues, javax.wsdl.Message inputMessage, javax.wsdl.BindingInput bindingInput)
          Go through the list of Namespaces.ODE_HTTP_EXTENSION_NS:header elements included in the input binding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

msgs

protected static final Messages msgs

binding

protected javax.wsdl.Binding binding
Constructor Detail

HttpMethodConverter

public HttpMethodConverter(javax.wsdl.Binding binding)
Method Detail

createHttpRequest

public org.apache.commons.httpclient.HttpMethod createHttpRequest(PartnerRoleMessageExchange odeMex,
                                                                  org.apache.commons.httpclient.params.HttpParams params)
                                                           throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException

prepareHttpMethod

protected org.apache.commons.httpclient.HttpMethod prepareHttpMethod(javax.wsdl.BindingOperation opBinding,
                                                                     java.lang.String verb,
                                                                     java.util.Map<java.lang.String,org.w3c.dom.Element> partValues,
                                                                     java.lang.String rootUri,
                                                                     org.apache.commons.httpclient.params.HttpParams params)
                                                              throws java.io.UnsupportedEncodingException
create and initialize the http method. Http Headers that may been passed in the params are not set in this method. Headers will be automatically set by HttpClient. See usages of HostParams.DEFAULT_HEADERS See org.apache.commons.httpclient.HttpMethodDirector#executeMethod(org.apache.commons.httpclient.HttpMethod)

Throws:
java.io.UnsupportedEncodingException

setHttpRequestHeaders

public void setHttpRequestHeaders(org.apache.commons.httpclient.HttpMethod method,
                                  java.util.Map<java.lang.String,org.w3c.dom.Element> partValues,
                                  javax.wsdl.Message inputMessage,
                                  javax.wsdl.BindingInput bindingInput)
Go through the list of Namespaces.ODE_HTTP_EXTENSION_NS:header elements included in the input binding. For each of them, set the HTTP Request Header with the static value defined by the attribute Namespaces.ODE_HTTP_EXTENSION_NS:value, or the part value mentionned in the attribute Namespaces.ODE_HTTP_EXTENSION_NS:part.


extractPartElements

protected java.util.Map<java.lang.String,org.w3c.dom.Element> extractPartElements(javax.wsdl.Message msgDef,
                                                                                  org.w3c.dom.Element message)

createPartElement

public org.w3c.dom.Element createPartElement(javax.wsdl.Part part,
                                             java.lang.String textContent)
Create the element to be associated with this part into the Message.
An element named with the part name will be returned. the content of this element depends on the part.

If the part has a non-null element name, a new element will be created and named accordingly then the text value is inserted in this new element.
else the given text content is simply set on the part element.

Parameters:
part -
textContent -
Returns:
an element named with the part name will be returned

createPartElement

public org.w3c.dom.Element createPartElement(javax.wsdl.Part part,
                                             org.w3c.dom.Element receivedElement)
Create the element to be associated with this part into the Message.

If the part has a non-null element name, the bodyElement is simply appended. Else if the bodyElement has a text content, the value is set to the message. Else append all nodes of bodyElement to the returned element. Attributes are ignored.

The name of the returned element is the part name.

Parameters:
part -
receivedElement -
Returns:
the element to insert "as is" to ODE message

extractHttpResponseHeaders

public void extractHttpResponseHeaders(Message odeMessage,
                                       org.apache.commons.httpclient.HttpMethod method,
                                       javax.wsdl.Message messageDef,
                                       javax.wsdl.BindingOutput bindingOutput)
Process the HTTP Response Headers.

First go through the list of Namespaces.ODE_HTTP_EXTENSION_NS:header elements included in the output binding. For each of them, set the header value as the value of the message part.
Then add all HTTP headers as header part in the message. The name of the header would be the part name.

Parameters:
odeMessage -
method -
messageDef -
bindingOutput -