soaprest
Class InvocationUtility

java.lang.Object
  extended by soaprest.InvocationUtility

@Copyright
public class InvocationUtility
extends java.lang.Object

Invocation utility.


Field Summary
private  javax.xml.bind.JAXBContext context
          JAXB Serialization Context.
private  WS info
          Web service information.
private  java.util.Map<java.lang.String,java.lang.Object> packageToFactory
          Map from package names to object factories.
 
Constructor Summary
InvocationUtility(java.lang.Object impl, java.lang.String packages)
          Construct an invocation utility.
 
Method Summary
 javax.xml.bind.JAXBElement<?> createElementForResponseWrapper(java.lang.Object wrapper)
          Create a JAXB element for a response wrapper object.
 SoapRestObject invokeFromSource(java.lang.Object object, javax.xml.transform.Source source, HTTPMethod httpMethod)
          Invoke an operation specified by a source.
 SoapRestObject invokeFromURL(java.lang.Object object, java.util.Map<java.lang.String,java.lang.String> params, HTTPMethod httpMethod)
          Invoke an operation specified by a URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

info

private WS info
Web service information.


context

private javax.xml.bind.JAXBContext context
JAXB Serialization Context.


packageToFactory

private java.util.Map<java.lang.String,java.lang.Object> packageToFactory
Map from package names to object factories.

Constructor Detail

InvocationUtility

public InvocationUtility(java.lang.Object impl,
                         java.lang.String packages)
                  throws java.lang.Exception
Construct an invocation utility.

Parameters:
impl - The web service implementation.
packages - The colon-delimited list of packages with serializable classes.
Throws:
java.lang.Exception - if an object factory is not available for a specified package.
Method Detail

invokeFromURL

public SoapRestObject invokeFromURL(java.lang.Object object,
                                    java.util.Map<java.lang.String,java.lang.String> params,
                                    HTTPMethod httpMethod)
                             throws SoapRestException
Invoke an operation specified by a URL. This is the dispatch operation for a REST web service invoked with the GET method.

Parameters:
object - The object on which to invoke the operation. This is the web service implementation.
params - A map from parameter names to parameter values, with the blank parameter name mapping to the operation name.
httpMethod - The HTTP method used for the invocation.
Returns:
The response object or null if the operation is oneway.
Throws:
SoapRestException - if the invocation is not properly defined or not found or fails.

invokeFromSource

public SoapRestObject invokeFromSource(java.lang.Object object,
                                       javax.xml.transform.Source source,
                                       HTTPMethod httpMethod)
                                throws SoapRestException
Invoke an operation specified by a source. This is the dispatch operation for a POST method. It can be either SOAP or REST.

Parameters:
object - The object on which to invoke the operation. This is the web service implementation.
source - The source of the request information.
httpMethod - The HTTP method used for the invocation.
Returns:
The response object or null if the operation is oneway.
Throws:
SoapRestException - if the invocation is not properly defined or not found or fails.

createElementForResponseWrapper

public javax.xml.bind.JAXBElement<?> createElementForResponseWrapper(java.lang.Object wrapper)
                                                              throws java.lang.Exception
Create a JAXB element for a response wrapper object.

Parameters:
wrapper - The response wrapper object.
Returns:
a JAXB element for a response wrapper object or null if the operation is oneway or the wrapper is null.
Throws:
java.lang.Exception - if an object factory is not available.