org.apache.wsif
Interface WSIFOperation

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
WSIFDefaultOperation, WSIFOperation_EJB, WSIFOperation_Java, WSIFOperation_JCA, WSIFOperation_Jms, WSIFOperation_ApacheAxis, WSIFOperation_ApacheSOAP, WSIFOperation_SoapRMI

public interface WSIFOperation
extends java.io.Serializable

A WSIFOperation is a handle on a particular operation of a portType that can be used to invoke web service methods. This interface is implemented by each provider. A WSIFOperation can be created using WSIFPort.createOperation(String).

Author:
Owen Burroughs , Ant Elder , Jeremy Hughes , Mark Whitlock

Method Summary
 WSIFMessage createFaultMessage()
          Create a fault message that may be received into via this port.
 WSIFMessage createFaultMessage(java.lang.String name)
          Create a fault message that may be received into via this port.
 WSIFMessage createInputMessage()
          Create an input message that will be sent via this port.
 WSIFMessage createInputMessage(java.lang.String name)
          Create an input message that will be sent via this port.
 WSIFMessage createOutputMessage()
          Create an output message that will be received into via this port.
 WSIFMessage createOutputMessage(java.lang.String name)
          Create an output message that will be received into via this port.
 void executeInputOnlyOperation(WSIFMessage input)
          Execute an input-only operation.
 WSIFCorrelationId executeRequestResponseAsync(WSIFMessage input)
          Execute an asynchronous request
 WSIFCorrelationId executeRequestResponseAsync(WSIFMessage input, WSIFResponseHandler handler)
          Execute an asynchronous request
 boolean executeRequestResponseOperation(WSIFMessage input, WSIFMessage output, WSIFMessage fault)
          Execute a request-response operation.
 void fireAsyncResponse(java.lang.Object response)
          fireAsyncResponse is called when a response has been received for a previous executeRequestResponseAsync call.
 WSIFMessage getContext()
          Gets the context information for this binding.
 boolean processAsyncResponse(java.lang.Object response, WSIFMessage output, WSIFMessage fault)
          Processes the response to an asynchronous request.
 void setContext(WSIFMessage context)
          Allows the application programmer or stub to pass context information to the binding.
 

Method Detail

executeRequestResponseOperation

public boolean executeRequestResponseOperation(WSIFMessage input,
                                               WSIFMessage output,
                                               WSIFMessage fault)
                                        throws WSIFException
Execute a request-response operation. The signature allows for input, output and fault messages. WSDL in fact allows one to describe the set of possible faults an operation may result in, however, only one fault can occur at any one time.
Parameters:
op - name of operation to execute
input - input message to send to the operation
output - an empty message which will be filled in if the operation invocation succeeds. If it does not succeed, the contents of this message are undefined. (This is a return value of this method.)
fault - an empty message which will be filled in if the operation invocation fails. If it succeeds, the contents of this message are undefined. (This is a return value of this method.)
Returns:
true or false indicating whether a fault message was generated or not. The truth value indicates whether the output or fault message has useful information.
Throws:
WSIFException - if something goes wrong.

executeRequestResponseAsync

public WSIFCorrelationId executeRequestResponseAsync(WSIFMessage input)
                                              throws WSIFException
Execute an asynchronous request
Parameters:
input - input message to send to the operation
Returns:
the correlation ID or the request. The correlation ID is used to associate the request with the WSIFOperation.
Throws:
WSIFException - if something goes wrong.

executeRequestResponseAsync

public WSIFCorrelationId executeRequestResponseAsync(WSIFMessage input,
                                                     WSIFResponseHandler handler)
                                              throws WSIFException
Execute an asynchronous request
Parameters:
input - input message to send to the operation
handler - the response handler that will be notified when the asynchronous response becomes available.
Returns:
the correlation ID or the request. The correlation ID is used to associate the request with the WSIFOperation.
Throws:
WSIFException - if something goes wrong.

fireAsyncResponse

public void fireAsyncResponse(java.lang.Object response)
                       throws WSIFException
fireAsyncResponse is called when a response has been received for a previous executeRequestResponseAsync call.
Parameters:
response - an Object representing the response
Throws:
WSIFException - if something goes wrong

processAsyncResponse

public boolean processAsyncResponse(java.lang.Object response,
                                    WSIFMessage output,
                                    WSIFMessage fault)
                             throws WSIFException
Processes the response to an asynchronous request. This is called for when the asynchronous operation was initiated without a WSIFResponseHandler, that is, by calling the executeRequestResponseAsync(WSIFMessage input) method.
Parameters:
response - an Object representing the response.
output - an empty message which will be filled in if the operation invocation succeeds. If it does not succeed, the contents of this message are undefined. (This is a return value of this method.)
fault - an empty message which will be filled in if the operation invocation fails. If it succeeds, the contents of this message are undefined. (This is a return value of this method.)
Returns:
true or false indicating whether a fault message was generated or not. The truth value indicates whether the output or fault message has useful information.
Throws:
WSIFException - if something goes wrong

executeInputOnlyOperation

public void executeInputOnlyOperation(WSIFMessage input)
                               throws WSIFException
Execute an input-only operation.
Parameters:
input - input message to send to the operation
Throws:
WSIFException - if something goes wrong.

setContext

public void setContext(WSIFMessage context)
Allows the application programmer or stub to pass context information to the binding. The Port implementation may use this context - for example to update a SOAP header. There is no definition of how a Port may utilize the context.
Parameters:
context - context information

getContext

public WSIFMessage getContext()
Gets the context information for this binding.
Returns:
context

createInputMessage

public WSIFMessage createInputMessage()
Create an input message that will be sent via this port. It is responsibility of caller to set message name.
Returns:
a new message

createInputMessage

public WSIFMessage createInputMessage(java.lang.String name)
Create an input message that will be sent via this port.
Parameters:
name - for the new message
Returns:
a new message

createOutputMessage

public WSIFMessage createOutputMessage()
Create an output message that will be received into via this port. It is responsibility of caller to set message name.
Returns:
a new message

createOutputMessage

public WSIFMessage createOutputMessage(java.lang.String name)
Create an output message that will be received into via this port.
Parameters:
name - for the new message
Returns:
a new message

createFaultMessage

public WSIFMessage createFaultMessage()
Create a fault message that may be received into via this port. It is responsibility of caller to set message name.
Returns:
a new message

createFaultMessage

public WSIFMessage createFaultMessage(java.lang.String name)
Create a fault message that may be received into via this port.
Parameters:
name - for the new message
Returns:
a new message


Copyright © 2002, 2002 Apache XML Project. All Rights Reserved.