JTR 4.0 API Documentation

jtr.ws.jaxws
Class JaxWsHelper

java.lang.Object
  extended by jtr.ws.jaxws.JaxWsHelper
All Implemented Interfaces:
IWsHelper

public class JaxWsHelper
extends java.lang.Object
implements IWsHelper

Implementation of the IWsHelper contract, based on the JAX-WS 2.1 API and the JAXB 2.1 API. This implementation is stateless, thus it can be profitably used by the JTR runtime as a shared-helper class for all those concrete runners requiring web-services support.
Please, also note that this implementation imposes that only JAXB-based objects are used as input and output parameters.

Since:
4.0
Version:
4.0
Author:
Francesco Russo

Field Summary
protected  org.apache.log4j.Logger logger
           
 
Constructor Summary
JaxWsHelper()
          Creates a new instance of JaxWsHelper
 
Method Summary
 void asynchronousInputOnlyInvoke(Binding binding)
          Deprecated. 
 void generateRuntimeConfig(WebServiceConfig wsCfg)
          This method "translates" the provided webservice configuration derived from the jtr.xml configuration file, into an object-oriented representation tailored for the underlying webservice invocation API in use.
 java.lang.Throwable getFaultCause(Binding binding)
          Deprecated. 
 java.lang.String getFaultMessageAsString(Binding binding)
          Deprecated. 
 boolean getMessageBooleanPart(Binding binding, java.lang.String partName, WsMsgType msgType)
          Deprecated. 
 byte getMessageBytePart(Binding binding, java.lang.String partName, WsMsgType msgType)
          Deprecated. 
 char getMessageCharPart(Binding binding, java.lang.String partName, WsMsgType msgType)
          Deprecated. 
 double getMessageDoublePart(Binding binding, java.lang.String partName, WsMsgType msgType)
          Deprecated. 
 float getMessageFloatPart(Binding binding, java.lang.String partName, WsMsgType msgType)
          Deprecated. 
 int getMessageIntPart(Binding binding, java.lang.String partName, WsMsgType msgType)
          Deprecated. 
 long getMessageLongPart(Binding binding, java.lang.String partName, WsMsgType msgType)
          Deprecated. 
 java.lang.Object getMessageObjectPart(Binding binding, java.lang.String partName, WsMsgType msgType)
          Deprecated. 
 java.lang.String[] getMessageParts(Binding binding, WsMsgType msgType)
          Deprecated. 
 java.lang.Object invoke(IRunnerWs runner, Binding binding, java.lang.Object input)
          This method performs a request/response synchronous webservice invocation.
 IWsResponse invokeAsync(IRunnerWs runner, Binding binding, java.lang.Object input)
          This method performs an asynchronous invocation of the webservice described by the binding parameter.
 java.util.concurrent.Future<?> invokeAsync(IRunnerWs runner, Binding binding, java.lang.Object input, IWsResponseListener rl)
          This method performs an asynchronous invocation of the webservice described by the binding parameter.
 void invokeOneWay(IRunnerWs runner, Binding binding, java.lang.Object input)
          This method performs a request only webservice invocation.
 void setMessageBooleanPart(Binding binding, java.lang.String partName, boolean part, WsMsgType msgType)
          Deprecated. 
 void setMessageBytePart(Binding binding, java.lang.String partName, byte part, WsMsgType msgType)
          Deprecated. 
 void setMessageCharPart(Binding binding, java.lang.String partName, char part, WsMsgType msgType)
          Deprecated. 
 void setMessageDoublePart(Binding binding, java.lang.String partName, double part, WsMsgType msgType)
          Deprecated. 
 void setMessageFloatPart(Binding binding, java.lang.String partName, float part, WsMsgType msgType)
          Deprecated. 
 void setMessageIntPart(Binding binding, java.lang.String partName, int part, WsMsgType msgType)
          Deprecated. 
 void setMessageLongPart(Binding binding, java.lang.String partName, long part, WsMsgType msgType)
          Deprecated. 
 void setMessageObjectPart(Binding binding, java.lang.String partName, java.lang.Object part, WsMsgType msgType)
          Deprecated. 
 boolean synchronousInvoke(Binding binding)
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.log4j.Logger logger
Constructor Detail

JaxWsHelper

public JaxWsHelper()
Creates a new instance of JaxWsHelper

Method Detail

generateRuntimeConfig

public void generateRuntimeConfig(WebServiceConfig wsCfg)
                           throws WsProviderException
Description copied from interface: IWsHelper
This method "translates" the provided webservice configuration derived from the jtr.xml configuration file, into an object-oriented representation tailored for the underlying webservice invocation API in use.

Specified by:
generateRuntimeConfig in interface IWsHelper
Parameters:
wsCfg - The static webservice configuration
Throws:
WsProviderException

invoke

public java.lang.Object invoke(IRunnerWs runner,
                               Binding binding,
                               java.lang.Object input)
                        throws WsProviderException
Description copied from interface: IWsHelper
This method performs a request/response synchronous webservice invocation. The input parameter is the invocation argument, while the returned Object instance is the result of the invocation.

Specified by:
invoke in interface IWsHelper
Parameters:
runner - The runner on whose behalf the service is invoked
binding - The JTR description of the webservice that must be invoked
input - The input message
Returns:
The output of the invoked webservice
Throws:
WsProviderException

invokeOneWay

public void invokeOneWay(IRunnerWs runner,
                         Binding binding,
                         java.lang.Object input)
                  throws WsProviderException
Description copied from interface: IWsHelper
This method performs a request only webservice invocation. The input parameter is the invocation argument.

Specified by:
invokeOneWay in interface IWsHelper
Parameters:
runner - The runner on whose behalf the service is invoked
binding - The JTR description of the webservice that must be invoked
input - The input message
Throws:
WsProviderException

invokeAsync

public java.util.concurrent.Future<?> invokeAsync(IRunnerWs runner,
                                                  Binding binding,
                                                  java.lang.Object input,
                                                  IWsResponseListener rl)
                                           throws WsProviderException
Description copied from interface: IWsHelper
This method performs an asynchronous invocation of the webservice described by the binding parameter. The returned Future instance can be used to check whether the response message has been received or not. Once the response message has been received the provided IWsResponseListener will be notified and will be able to inspect the response.

Specified by:
invokeAsync in interface IWsHelper
Parameters:
runner - The runner on whose behalf the service is invoked
binding - The JTR description of the webservice that must be invoked
input - The input message
rl - The listener to be notified upon response reception
Returns:
The Future required to check for response availability
Throws:
WsProviderException

invokeAsync

public IWsResponse invokeAsync(IRunnerWs runner,
                               Binding binding,
                               java.lang.Object input)
                        throws WsProviderException
Description copied from interface: IWsHelper
This method performs an asynchronous invocation of the webservice described by the binding parameter. The returned IWsResponse instance is required to check for response mesage availability and to inspect the response itself.

Specified by:
invokeAsync in interface IWsHelper
Parameters:
runner - The runner on whose behalf the service is invoked
binding - The JTR description of the webservice that must be invoked
input - The input message
Returns:
The IWsResponse instance required to check for response mesage availability and to inspect the response itself
Throws:
WsProviderException

synchronousInvoke

@Deprecated
public boolean synchronousInvoke(Binding binding)
                          throws WsProviderException
Deprecated. 

Description copied from interface: IWsHelper
This method performs a synchronous invocation of the webservice, following a request/response pattern.

Specified by:
synchronousInvoke in interface IWsHelper
Parameters:
binding - The webservice binding to be used
Returns:
boolean The outcome of the invocation
Throws:
WsProviderException

asynchronousInputOnlyInvoke

@Deprecated
public void asynchronousInputOnlyInvoke(Binding binding)
                                 throws WsProviderException
Deprecated. 

Description copied from interface: IWsHelper
This method performs an asynchronous invocation of the webservice, following a one-way messaging pattern.

Specified by:
asynchronousInputOnlyInvoke in interface IWsHelper
Parameters:
binding - The webservice binding to be used
Throws:
WsProviderException

setMessageObjectPart

@Deprecated
public void setMessageObjectPart(Binding binding,
                                            java.lang.String partName,
                                            java.lang.Object part,
                                            WsMsgType msgType)
                          throws WsProviderException
Deprecated. 

Description copied from interface: IWsHelper
This method sets the Object content of a specific message part.

Specified by:
setMessageObjectPart in interface IWsHelper
Parameters:
binding - The webservice binding to be used
partName - The name of the message part
part - The actual value of the part
msgType - The message type (input, output, fault)
Throws:
WsProviderException
See Also:
WsMsgType

setMessageIntPart

@Deprecated
public void setMessageIntPart(Binding binding,
                                         java.lang.String partName,
                                         int part,
                                         WsMsgType msgType)
Deprecated. 

Description copied from interface: IWsHelper
This method sets the int content of a specific message part.

Specified by:
setMessageIntPart in interface IWsHelper
Parameters:
binding - The webservice binding to be used
partName - The name of the message part
part - The actual value of the part
msgType - The message type (input, output, fault)
See Also:
WsMsgType

setMessageBooleanPart

@Deprecated
public void setMessageBooleanPart(Binding binding,
                                             java.lang.String partName,
                                             boolean part,
                                             WsMsgType msgType)
Deprecated. 

Description copied from interface: IWsHelper
This method sets the boolean content of a specific message part.

Specified by:
setMessageBooleanPart in interface IWsHelper
Parameters:
binding - The webservice binding to be used
partName - The name of the message part
part - The actual value of the part
msgType - The message type (input, output, fault)
See Also:
WsMsgType

setMessageBytePart

@Deprecated
public void setMessageBytePart(Binding binding,
                                          java.lang.String partName,
                                          byte part,
                                          WsMsgType msgType)
Deprecated. 

Description copied from interface: IWsHelper
This method sets the byte content of a specific message part.

Specified by:
setMessageBytePart in interface IWsHelper
Parameters:
binding - The webservice binding to be used
partName - The name of the message part
part - The actual value of the part
msgType - The message type (input, output, fault)
See Also:
WsMsgType

setMessageCharPart

@Deprecated
public void setMessageCharPart(Binding binding,
                                          java.lang.String partName,
                                          char part,
                                          WsMsgType msgType)
Deprecated. 

Description copied from interface: IWsHelper
This method sets the char content of a specific message part.

Specified by:
setMessageCharPart in interface IWsHelper
Parameters:
binding - The webservice binding to be used
partName - The name of the message part
part - The actual value of the part
msgType - The message type (input, output, fault)
See Also:
WsMsgType

setMessageDoublePart

@Deprecated
public void setMessageDoublePart(Binding binding,
                                            java.lang.String partName,
                                            double part,
                                            WsMsgType msgType)
Deprecated. 

Description copied from interface: IWsHelper
This method sets the double content of a specific message part.

Specified by:
setMessageDoublePart in interface IWsHelper
Parameters:
binding - The webservice binding to be used
partName - The name of the message part
part - The actual value of the part
msgType - The message type (input, output, fault)
See Also:
WsMsgType

setMessageFloatPart

@Deprecated
public void setMessageFloatPart(Binding binding,
                                           java.lang.String partName,
                                           float part,
                                           WsMsgType msgType)
Deprecated. 

Description copied from interface: IWsHelper
This method sets the float content of a specific message part.

Specified by:
setMessageFloatPart in interface IWsHelper
Parameters:
binding - The webservice binding to be used
partName - The name of the message part
part - The actual value of the part
msgType - The message type (input, output, fault)
See Also:
WsMsgType

setMessageLongPart

@Deprecated
public void setMessageLongPart(Binding binding,
                                          java.lang.String partName,
                                          long part,
                                          WsMsgType msgType)
Deprecated. 

Description copied from interface: IWsHelper
This method sets the long content of a specific message part.

Specified by:
setMessageLongPart in interface IWsHelper
Parameters:
binding - The webservice binding to be used
partName - The name of the message part
part - The actual value of the part
msgType - The message type (input, output, fault)
See Also:
WsMsgType

getMessageObjectPart

@Deprecated
public java.lang.Object getMessageObjectPart(Binding binding,
                                                        java.lang.String partName,
                                                        WsMsgType msgType)
                                      throws WsProviderException
Deprecated. 

Description copied from interface: IWsHelper
This method gets the Object content of a specific message part.

Specified by:
getMessageObjectPart in interface IWsHelper
Parameters:
binding - The webservice binding to be used
partName - The name of the message part
msgType - The message type (input, output, fault)
Returns:
Object The content
Throws:
WsProviderException

getMessageIntPart

@Deprecated
public int getMessageIntPart(Binding binding,
                                        java.lang.String partName,
                                        WsMsgType msgType)
                      throws WsProviderException
Deprecated. 

Description copied from interface: IWsHelper
This method gets the int content of a specific message part.

Specified by:
getMessageIntPart in interface IWsHelper
Parameters:
binding - The webservice binding to be used
partName - The name of the message part
msgType - The message type (input, output, fault)
Returns:
int The content
Throws:
WsProviderException

getMessageBooleanPart

@Deprecated
public boolean getMessageBooleanPart(Binding binding,
                                                java.lang.String partName,
                                                WsMsgType msgType)
                              throws WsProviderException
Deprecated. 

Description copied from interface: IWsHelper
This method gets the boolean content of a specific message part.

Specified by:
getMessageBooleanPart in interface IWsHelper
Parameters:
binding - The webservice binding to be used
partName - The name of the message part
msgType - The message type (input, output, fault)
Returns:
boolean The content
Throws:
WsProviderException

getMessageBytePart

@Deprecated
public byte getMessageBytePart(Binding binding,
                                          java.lang.String partName,
                                          WsMsgType msgType)
                        throws WsProviderException
Deprecated. 

Description copied from interface: IWsHelper
This method gets the byte content of a specific message part.

Specified by:
getMessageBytePart in interface IWsHelper
Parameters:
binding - The webservice binding to be used
partName - The name of the message part
msgType - The message type (input, output, fault)
Returns:
byte The content
Throws:
WsProviderException

getMessageCharPart

@Deprecated
public char getMessageCharPart(Binding binding,
                                          java.lang.String partName,
                                          WsMsgType msgType)
                        throws WsProviderException
Deprecated. 

Description copied from interface: IWsHelper
This method gets the char content of a specific message part.

Specified by:
getMessageCharPart in interface IWsHelper
Parameters:
binding - The webservice binding to be used
partName - The name of the message part
msgType - The message type (input, output, fault)
Returns:
char The content
Throws:
WsProviderException

getMessageDoublePart

@Deprecated
public double getMessageDoublePart(Binding binding,
                                              java.lang.String partName,
                                              WsMsgType msgType)
                            throws WsProviderException
Deprecated. 

Description copied from interface: IWsHelper
This method gets the double content of a specific message part.

Specified by:
getMessageDoublePart in interface IWsHelper
Parameters:
binding - The webservice binding to be used
partName - The name of the message part
msgType - The message type (input, output, fault)
Returns:
double The content
Throws:
WsProviderException

getMessageFloatPart

@Deprecated
public float getMessageFloatPart(Binding binding,
                                            java.lang.String partName,
                                            WsMsgType msgType)
                          throws WsProviderException
Deprecated. 

Description copied from interface: IWsHelper
This method gets the float content of a specific message part.

Specified by:
getMessageFloatPart in interface IWsHelper
Parameters:
binding - The webservice binding to be used
partName - The name of the message part
msgType - The message type (input, output, fault)
Returns:
float The content
Throws:
WsProviderException

getMessageLongPart

@Deprecated
public long getMessageLongPart(Binding binding,
                                          java.lang.String partName,
                                          WsMsgType msgType)
                        throws WsProviderException
Deprecated. 

Description copied from interface: IWsHelper
This method gets the long content of a specific message part.

Specified by:
getMessageLongPart in interface IWsHelper
Parameters:
binding - The webservice binding to be used
partName - The name of the message part
msgType - The message type (input, output, fault)
Returns:
long The content
Throws:
WsProviderException

getMessageParts

@Deprecated
public java.lang.String[] getMessageParts(Binding binding,
                                                     WsMsgType msgType)
Deprecated. 

Description copied from interface: IWsHelper
Returns the String[] of the part names of the given message.

Specified by:
getMessageParts in interface IWsHelper
Returns:
String[] The part names

getFaultMessageAsString

@Deprecated
public java.lang.String getFaultMessageAsString(Binding binding)
Deprecated. 

Description copied from interface: IWsHelper
This method returns the String representation of the fault message associated with the given webservice operation.

Specified by:
getFaultMessageAsString in interface IWsHelper
Parameters:
binding - The webservice binding to be used
Returns:
String The fault message in a human-readable format

getFaultCause

@Deprecated
public java.lang.Throwable getFaultCause(Binding binding)
Deprecated. 

Description copied from interface: IWsHelper
This method returns the cause of the webservice failure as a WsProviderException instance.

Specified by:
getFaultCause in interface IWsHelper
Parameters:
binding - The webservice binding to be used
Returns:
Throwable The cause of the fault

The JTR Project is licensed under GPL version 2