org.ow2.petals.binding.soap.listener.outgoing
Class RESTCaller

java.lang.Object
  extended by org.ow2.petals.binding.soap.listener.outgoing.AbstractExternalServiceCaller
      extended by org.ow2.petals.binding.soap.listener.outgoing.RESTCaller
Direct Known Subclasses:
JSONCaller

public class RESTCaller
extends AbstractExternalServiceCaller

A REST service caller.

Since:
3.1
Author:
Christophe HAMERLING - eBM WebSourcing

Field Summary
static java.lang.String DEFAULT_HTTP_METHOD
           
 
Fields inherited from class org.ow2.petals.binding.soap.listener.outgoing.AbstractExternalServiceCaller
logger, SOAP_VERSION_11, SOAP_VERSION_12, soapContext
 
Constructor Summary
RESTCaller(SoapComponentContext soapContext, java.util.logging.Logger logger)
          Creates a new instance of RESTCaller
 
Method Summary
protected  java.net.URI buildEPR(java.lang.String address, org.apache.axiom.om.OMElement element)
          Build the EPR for the REST service
protected  org.apache.axiom.om.OMElement buildMessageBody(javax.xml.namespace.QName operation, org.apache.axiom.om.OMElement source)
          Build the REST message from the JBI one
 void call(org.ow2.petals.component.framework.api.message.Exchange exchange, org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions, org.ow2.petals.component.framework.jbidescriptor.generated.Provides provides)
          Process the message exchange (call an external WS).
protected  org.apache.axis2.client.Options createOptions(org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions, java.lang.String httpMethod, java.net.URI epr)
          Create the Options object
 java.lang.String getCallerType()
          Returns the type of dispatcher.
protected  java.lang.String getHTTPMethod(org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions)
           
protected static java.lang.String retrieveServiceAddress(org.ow2.petals.component.framework.api.message.Exchange exchange, org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions)
          Get the final service address for this endpoint and message exchange.
protected  org.apache.axiom.om.OMElement sourceAsOMElement(javax.xml.transform.Source source)
           
 
Methods inherited from class org.ow2.petals.binding.soap.listener.outgoing.AbstractExternalServiceCaller
handleException, handleException, handleException, retrieveChunkedMode, retrieveCleanupTransport, retrieveDefaultSOAPAction, retrieveProxySettings, retrieveSOAPEnvelopeNamespaceURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_HTTP_METHOD

public static final java.lang.String DEFAULT_HTTP_METHOD
See Also:
Constant Field Values
Constructor Detail

RESTCaller

public RESTCaller(SoapComponentContext soapContext,
                  java.util.logging.Logger logger)
Creates a new instance of RESTCaller

Parameters:
soapContext -
logger -
Method Detail

retrieveServiceAddress

protected static final java.lang.String retrieveServiceAddress(org.ow2.petals.component.framework.api.message.Exchange exchange,
                                                               org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions)
Get the final service address for this endpoint and message exchange. This service address is defined like this :
  1. If it exists, get the address from the exchange org.ow2.petals.component.framework.api.Constants.WSStar.ADDRESSING_KEY property (OASIS/W3C standard)
  2. Else, if it exists, get the address from the exchange WSA-TO property if found (Microsoft/IBM standard)
  3. Else, get the address from the Service unit

Parameters:
exchange - The exchange
extensions - The extensions
Returns:
the address

buildEPR

protected java.net.URI buildEPR(java.lang.String address,
                                org.apache.axiom.om.OMElement element)
                         throws java.net.URISyntaxException
Build the EPR for the REST service

Parameters:
address -
Returns:
Throws:
java.net.URISyntaxException
java.lang.Exception

buildMessageBody

protected org.apache.axiom.om.OMElement buildMessageBody(javax.xml.namespace.QName operation,
                                                         org.apache.axiom.om.OMElement source)
                                                  throws org.ow2.petals.component.framework.api.exception.PEtALSCDKException,
                                                         javax.xml.stream.XMLStreamException,
                                                         javax.jbi.messaging.MessagingException
Build the REST message from the JBI one

Parameters:
exchange -
Returns:
Throws:
org.ow2.petals.component.framework.api.exception.PEtALSCDKException
javax.xml.stream.XMLStreamException
javax.jbi.messaging.MessagingException

call

public void call(org.ow2.petals.component.framework.api.message.Exchange exchange,
                 org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions,
                 org.ow2.petals.component.framework.jbidescriptor.generated.Provides provides)
Description copied from class: AbstractExternalServiceCaller
Process the message exchange (call an external WS).

Specified by:
call in class AbstractExternalServiceCaller

createOptions

protected org.apache.axis2.client.Options createOptions(org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions,
                                                        java.lang.String httpMethod,
                                                        java.net.URI epr)
Create the Options object

Parameters:
extensions -
httpMethod -
epr -
Returns:

getCallerType

public java.lang.String getCallerType()
Description copied from class: AbstractExternalServiceCaller
Returns the type of dispatcher.

Specified by:
getCallerType in class AbstractExternalServiceCaller
Returns:

getHTTPMethod

protected java.lang.String getHTTPMethod(org.ow2.petals.component.framework.api.configuration.ConfigurationExtensions extensions)
Parameters:
jbiOperation -
extensions -
Returns:

sourceAsOMElement

protected org.apache.axiom.om.OMElement sourceAsOMElement(javax.xml.transform.Source source)
                                                   throws org.ow2.petals.component.framework.api.exception.PEtALSCDKException,
                                                          javax.xml.stream.XMLStreamException,
                                                          javax.jbi.messaging.MessagingException
Parameters:
source -
Returns:
Throws:
org.ow2.petals.component.framework.api.exception.PEtALSCDKException
javax.xml.stream.XMLStreamException
javax.jbi.messaging.MessagingException


Copyright © 2005-2012 Petals Link (EBM Websourcing). All Rights Reserved.