org.systinet.wasp.webservice
Interface CallContext


public interface CallContext

CallContext represents context valid through one call. There can be stored any data in given call context. For instance, a server header processor can pass some data to the service or a client application can pass some data to given interceptor or header processor which is valid for the current call only. An additional data associated with the this context is accessible using the method getContextData(). On the client side there are accessible also all values of the ServiceClientContext data map and on the server side there are accessible also all values of the ServiceEndpointContext data map.

 ServiceClient client = ServiceClient.create(serviceURL);
 client.getInterceptors().insert(new MyInterceptor(), Interceptors.DIRECTION_INOUT);

 MyServiceIface proxy = (MyServiceIface)client.createProxy(MyServiceIface.class);
 client.getCallContext().getContextData().put("mykey", ...);
 proxy.hello("Hello world!");

 public class MyInterceptor implements TransportInterceptor
 {
     public void intercept(Connection connection, InterceptorChain chain, int position)
         throws StopProcessingException, IOException
     {
         ... = Current.getCallContext().getContextData().get("mykey");
     ...
 }

Since:
4.5
Component:
Core

Field Summary
static java.lang.String ADDRESSING_HEADERS_INPUT
          Parsed AddressingHeaders of the input message.
static java.lang.String ADDRESSING_HEADERS_OUTPUT
          AddressingHeaders that will be attached to the output message.
static java.lang.String DEFAULT_MIME_CONTENT_TRANSFER_ENCODING
          Default Content-Transfer-Encoding for MIME messages (attachments).
static java.lang.String HTTP_PROXY_PASSWORD
          The key associated with the HTTP proxy password is used to proxy authenticate.
static java.lang.String HTTP_PROXY_USER_NAME
          The key associated with the HTTP proxy username is used to proxy authenticate.
static java.lang.String HTTP_REQUEST_CHUNKING
          The key associated with HTTP chunging of client requests.
static java.lang.String INSTANCE_ID
          This key holds the actual instance ID in the service client context (on the client side) or in the call context (on the server side).
static java.lang.String LAZY_INPUT_PROCESSING
          Services that do not process input within the thread in which they were invoked (e.g.
static java.lang.String MAIL_INPUT_PASSWORD
          The key associated with the MAIL input password.
static java.lang.String MAIL_OUTPUT_FROM
          The key associated with the MAIL output reverse path.
static java.lang.String MAIL_OUTPUT_SERVER
          The key associated with the MAIL output server.
static java.lang.String MTOM_ATTACHMENT_SIZE_TRESHOLD
          An non-negative Integer values representing the treshold in bytes.
static java.lang.String MTOM_MAX_ATTACHMENT_PARTS
          An non-negative Integer value representing maximal number of MIME attachments parts used in XOP.
static java.lang.String POLICY_INPUT
          Effective EffectivePolicy of the input message.
static java.lang.String POLICY_OUTPUT
          Effective EffectivePolicy of the output message.
static java.lang.String SEND_RESPONSE_BEFORE_REQUEST_READ_COMPLETE
          Allows or disallows to start sending response before complete request is received.
static java.lang.String SEQUENCE_INPUT
          Sequence used in input processing.
static java.lang.String SEQUENCE_OUTPUT
          A ThreadLocal containing the Sequence used in output processing.
static java.lang.String SERVLET
          This constant is a key to context data for active Servlet.
static java.lang.String SERVLET_REQUEST
          This constant is a key to context data for active ServeltRequest.
static java.lang.String SERVLET_RESPONSE
          This constant is a key to context data for active ServletResponse.
static java.lang.String TRANSPORT_CONNECTION
          This constant is a key to context data for active transport connection.
static java.lang.String TRANSPORT_CONNECTION_TIMEOUT
          This constant is a key to context data for transport connection timout.
static java.lang.String UNWRAPPED_PROXY_INTERFACE
          Instruct invocation framework how to parse WSDL.
static java.lang.String USE_HREF_IN_BODY_FOR_MIME
          Allows to override default value of useHrefInBodyForMime.
static java.lang.String USE_MTOM
          Overrides default value of useMtomXop element in clientconf.xml and serverconf.xml.
static java.lang.String WSDL_BINDING_STYLE
          This key holds the actual style.
static java.lang.String WSDL_ENCODING_URI
          This key holds the actual encoding.
static java.lang.String WSDL_GET_USE_HTTP_BASIC_IN_FIRST_ATTEMP
          This key indicates that when getting WSDL (and included files, either WSDL or XML Schemas from the same host), the first attempt should use HTTP Basic Authentification.
static java.lang.String XML_PROTOCOL
          This key holds the actual XML protocol version in the call context (on the client side and also on the server side).
 
Method Summary
 java.util.Map getContextData()
          Returns map of additional data associated with this context.
 

Field Detail

TRANSPORT_CONNECTION

public static final java.lang.String TRANSPORT_CONNECTION
This constant is a key to context data for active transport connection.

On the client side you can obtain ClientConnection. This connection is the connection from client (you) to target server on which you are invoking a service.

On the server side you obtain ServerConnection. This connection is the connection which has cause invocation.

See Also:
Constant Field Values

TRANSPORT_CONNECTION_TIMEOUT

public static final java.lang.String TRANSPORT_CONNECTION_TIMEOUT
This constant is a key to context data for transport connection timout.

It's valid for the client side only, value type is Integer and timeout is in milliseconds. See ClientConnection.setTimeout(int) for more information.

See Also:
Constant Field Values

SERVLET_REQUEST

public static final java.lang.String SERVLET_REQUEST
This constant is a key to context data for active ServeltRequest.

On server side if you are using servlet transport (you have deployed WSO2 SOA Enablement Server in some Servlet container), you obtain HttpServletRequest for current invocation else you obtain null.

On client side, returns null.

See Also:
Constant Field Values

SERVLET_RESPONSE

public static final java.lang.String SERVLET_RESPONSE
This constant is a key to context data for active ServletResponse.

On server side if you are using servlet transport (you have deployed WSO2 SOA Enablement Server in some Servlet container), you obtain HttpServletResponse for current invocation else you obtain null.

On client side, returns null.

See Also:
Constant Field Values

SERVLET

public static final java.lang.String SERVLET
This constant is a key to context data for active Servlet.

On server side if you are using servlet transport (you have deployed WSO2 SOA Enablement Server in some Servlet container), you obtain HttpServlet for current invocation else you obtain null.

On client side, returns null.

See Also:
Constant Field Values

INSTANCE_ID

public static final java.lang.String INSTANCE_ID

This key holds the actual instance ID in the service client context (on the client side) or in the call context (on the server side).

INSTANCE_ID is mainly used by stateful web services or remote references.

You can also use INSTANCE_ID to control sessions (on both client and server side). If service sets INSTANCE_ID firt time it is relayed to the client and stored in service client context. If client calls a service and INSTANCE_ID is set in service client context it is relayed to the called service (and stored in call context).

See Also:
Constant Field Values

XML_PROTOCOL

public static final java.lang.String XML_PROTOCOL
This key holds the actual XML protocol version in the call context (on the client side and also on the server side). Processing units (interceptors, JAX-RPC handlers, ...) can use this key to determine XML protocol that is currently beeing used.

See Also:
WaspSOAPMessage.XML_PROTOCOL_SOAP11, WaspSOAPMessage.XML_PROTOCOL_SOAP12, Constant Field Values

WSDL_ENCODING_URI

public static final java.lang.String WSDL_ENCODING_URI
This key holds the actual encoding. If set to null literal use is assumed. If set to Constants.SOAP_ENC_NS SOAP 1.1 encoding is assumed and if set to Constants.SOAP12_ENC_NS SOAP 1.2 encoding is used.

See Also:
Constant Field Values

WSDL_BINDING_STYLE

public static final java.lang.String WSDL_BINDING_STYLE
This key holds the actual style. If set to null document style is assumed. If set to Constants.WSDL_BINDING_STYLE_DOCUMENT WSDL document style is assumed and if set to Constants.WSDL_BINDING_STYLE_RPC, RPC style is used.

See Also:
Constant Field Values

HTTP_REQUEST_CHUNKING

public static final java.lang.String HTTP_REQUEST_CHUNKING
The key associated with HTTP chunging of client requests. This property has a string value equals to true if there is a request chunking required. The default value is false - no request chunking.

See Also:
Constant Field Values

HTTP_PROXY_USER_NAME

public static final java.lang.String HTTP_PROXY_USER_NAME
The key associated with the HTTP proxy username is used to proxy authenticate. This property has a string value.

See Also:
Constant Field Values

HTTP_PROXY_PASSWORD

public static final java.lang.String HTTP_PROXY_PASSWORD
The key associated with the HTTP proxy password is used to proxy authenticate. This property has a string value.

See Also:
Constant Field Values

WSDL_GET_USE_HTTP_BASIC_IN_FIRST_ATTEMP

public static final java.lang.String WSDL_GET_USE_HTTP_BASIC_IN_FIRST_ATTEMP
This key indicates that when getting WSDL (and included files, either WSDL or XML Schemas from the same host), the first attempt should use HTTP Basic Authentification. Otherwise the authetification header is sent only after server returned 401 Unauthorized status code.

See Also:
Constant Field Values

MAIL_OUTPUT_SERVER

public static final java.lang.String MAIL_OUTPUT_SERVER
The key associated with the MAIL output server. This property has a string value like smtp://smtp.idoox.com.

See Also:
Constant Field Values

MAIL_OUTPUT_FROM

public static final java.lang.String MAIL_OUTPUT_FROM
The key associated with the MAIL output reverse path. This property has a string value like wasp@idoox.com.

See Also:
Constant Field Values

MAIL_INPUT_PASSWORD

public static final java.lang.String MAIL_INPUT_PASSWORD
The key associated with the MAIL input password. This property has a string value and is used like the password for mail input server (for example, POP client transport) when new client connection is created - it's passed in properties in Transport.newConnection(org.idoox.transport.URI, org.idoox.transport.TransportMethod, java.util.Map).

See Also:
Constant Field Values

LAZY_INPUT_PROCESSING

public static final java.lang.String LAZY_INPUT_PROCESSING

Services that do not process input within the thread in which they were invoked (e.g. OnewayListener that processes request in special "worker" thread) need to set this property to Boolean.TRUE. Such services MUST also release input soap message (WaspSOAPMessage.release()) after input message was processed (whole input was read).

Warning: If service sets this key to Boolean.TRUE and does not release input soap message then server resources will be blocked.

See Also:
Constant Field Values

UNWRAPPED_PROXY_INTERFACE

public static final java.lang.String UNWRAPPED_PROXY_INTERFACE
Instruct invocation framework how to parse WSDL. If you wan to unwrap elements in WSDL set this property in CallContext to Boolean.TRUE, else set it to Boolean.FALSE.

See Also:
Constant Field Values

ADDRESSING_HEADERS_INPUT

public static final java.lang.String ADDRESSING_HEADERS_INPUT
Parsed AddressingHeaders of the input message. They are put to the CallContext by the active addressing headers provider (i.e. the WS-Addressing handler).

See Also:
Constant Field Values

ADDRESSING_HEADERS_OUTPUT

public static final java.lang.String ADDRESSING_HEADERS_OUTPUT
AddressingHeaders that will be attached to the output message. When found in the CallContext by the active addressing headers provider (i.e. the WS-Addressing handler), they are attached to the outgoing message.

See Also:
Constant Field Values

SEQUENCE_INPUT

public static final java.lang.String SEQUENCE_INPUT
Sequence used in input processing. It is stored to the context by active WS-RM implementation.

See Also:
Constant Field Values

SEQUENCE_OUTPUT

public static final java.lang.String SEQUENCE_OUTPUT
A ThreadLocal containing the Sequence used in output processing. It is stored to the context by the Sequence API implementation on applications demand and is used by the WS-RM implementation to manage the sequence related data.

See Also:
Constant Field Values

POLICY_INPUT

public static final java.lang.String POLICY_INPUT
Effective EffectivePolicy of the input message. It is put to the CallContext when the processing of an input message is started and can be used by arbitrary message processing unit to check appropriate assertions.

See Also:
Constant Field Values

POLICY_OUTPUT

public static final java.lang.String POLICY_OUTPUT
Effective EffectivePolicy of the output message. It is put to the CallContext when the processing of an output message is started and can be used by arbitrary message processing unit to check appropriate assertions.

See Also:
Constant Field Values

DEFAULT_MIME_CONTENT_TRANSFER_ENCODING

public static final java.lang.String DEFAULT_MIME_CONTENT_TRANSFER_ENCODING
Default Content-Transfer-Encoding for MIME messages (attachments). If set in call context when MIME message is created in transport, all parts of the MIME message will have this Content-Transfer-Encoding, except parts that have this header explicitly set. Overrides all settings in clientconf.xml and serverconf.xml.

See Also:
Constant Field Values

USE_HREF_IN_BODY_FOR_MIME

public static final java.lang.String USE_HREF_IN_BODY_FOR_MIME
Allows to override default value of useHrefInBodyForMime. Register an instance of IWasp.UseHrefInBodyValue

See Also:
IWasp.UseHrefInBodyValue, Constant Field Values

USE_MTOM

public static final java.lang.String USE_MTOM
Overrides default value of useMtomXop element in clientconf.xml and serverconf.xml. Acceptable values are never, always and auto

See Also:
Constant Field Values

MTOM_MAX_ATTACHMENT_PARTS

public static final java.lang.String MTOM_MAX_ATTACHMENT_PARTS
An non-negative Integer value representing maximal number of MIME attachments parts used in XOP. In other works max number of xop:Includes in the root part.

See Also:
Constant Field Values

MTOM_ATTACHMENT_SIZE_TRESHOLD

public static final java.lang.String MTOM_ATTACHMENT_SIZE_TRESHOLD
An non-negative Integer values representing the treshold in bytes. Should some attachment part in XOP package contain less bytes than specified by this value, xop:Include is not used and the value is inlined into the root part.

See Also:
Constant Field Values

SEND_RESPONSE_BEFORE_REQUEST_READ_COMPLETE

public static final java.lang.String SEND_RESPONSE_BEFORE_REQUEST_READ_COMPLETE
Allows or disallows to start sending response before complete request is received. This setting is effective if both input and output message contain attachments.

Should be disabled if the service acts as a filter processing the input and the client does not receive until the complete message is send. In this case the system could fall into a silent deadlock.

A key is asociated with a Boolean value.

See Also:
Constant Field Values
Method Detail

getContextData

public java.util.Map getContextData()
Returns map of additional data associated with this context.

Returns:
Map of additional data