# com.bea.control
JwsContext Interface

public interface JwsContext
extends `Context`

Provides access to container services that support web services (JWS files). Represents the execution context of the web service. Methods in this interface can be used to access out-of-band data for communication with other web service architectures and to manage conversations.
For more information on building web services, see Building Web Services.

Related Topics

``Context``

All Superinterfaces
  `Context`, `Serializable`

All Known Subinterfaces
  `JwsContext`

## Nested Class Summary

`public static interface` | `JwsContext.Callback` The Callback interface defines events that can be received through the `Context``` object.

Nested classes from interface weblogic.jws.control`.`Context``
``Context.Callback``

## Method Summary

`public `String`` | `getCallbackLocation`() Retrieves the URL set by a setCallbackLocation method, or retrieves the callback URL if it was set via SOAP headers.
`public `String`` | `getCallbackPassword`() Gets the password used for credentials in callbacks.
`public `String`` | `getCallbackUsername`() Gets the user name used for credentials in callbacks.
`public `Element`[]` | `getInputHeaders`() Returns the SOAP headers that arrived with the current method invocation message.
`public `Protocol`` | `getProtocol`() Gets the protocol of the current request.
`public boolean` | `getUnderstoodInputHeaders`() Returns the value most recently set by a call to `setUnderstoodInputHeaders```.
`public void` | `setCallbackLocation`(`String` url) Specifies the URL to which a web service callback should be sent.
`public void` | `setCallbackLocation`(`URL` url) Specifies the URL to which a web service callback should be sent.
`public void` | `setCallbackPassword`(`String` password) Sets the password to use for credentials in callbacks.
`public void` | `setCallbackUsername`(`String` username) Sets the user name to use for credentials in callbacks.
`public void` | `setOutputHeaders`(`Element`[] headers) Set the SOAP headers to be sent with outgoing messages to the client.
`public void` | `setUnderstoodInputHeaders`(boolean understood) Indicates whether input headers were understood.

Methods from interface `weblogic.jws.control.`Context``
``finishConversation`, `getCallerPrincipal`, `getCurrentAge`, `getCurrentIdleTime`, `getLogger`, `getMaxAge`, `getMaxIdleTime`, `getService`, `isCallerInRole`, `isFinished`, `resetIdleTime`, `setMaxAge`, `setMaxAge`, `setMaxIdleTime`, `setMaxIdleTime``

## Method Detail

### getCallbackLocation() Method

DEPRECATED Supported for backward compatibility only; as of WebLogic Platform 8.1, replaced by `com.bea.control.ServiceControl.getEndPoint()```.

    public String getCallbackLocation()

Retrieves the URL set by a setCallbackLocation method, or retrieves the callback URL if it was set via SOAP headers.
You can call getCallbackLocation() to retrieve the URL set with JwsContext.setCallbackLocation, or to discover the URL if it was set via SOAP headers when a conversation start method was called.
Deprecated: JWS callback interfaces should extend ServiceControl, and then ServiceControl.getEndpoint() can be called on a callback instance to set the callback destination.

#### Returns

The URL to which callbacks should be sent.

### getCallbackPassword() Method

DEPRECATED Supported for backward compatibility only; as of WebLogic Platform 8.1, replaced by `com.bea.control.ServiceControl.getPassword()```.

    public String getCallbackPassword()

Gets the password used for credentials in callbacks. The password may have been specified by the client as part of the callbackLocation conversation start SOAP header, or it may have been set by a call to JwsContext.setCallbackPassword().
Deprecated: JWS callback interfaces should extend ServiceControl, and then call ServiceControl.getPassword() on a callback instance.

#### Returns

The password that will be used for callbacks to the client in the current conversation.

### getCallbackUsername() Method

DEPRECATED Supported for backward compatibility only; as of WebLogic Platform 8.1, replaced by `com.bea.control.ServiceControl.getUsername()```.

    public String getCallbackUsername()

Gets the user name used for credentials in callbacks. The username may have been specified by the client as part of the callbackLocation conversation start SOAP header, or it may have been set by a call to JwsContext.setCallbackUsername().
Deprecated: JWS callback interfaces should extend ServiceControl, and then call ServiceControl.getUsername() on a callback instance.

#### Returns

The username that will be used for callbacks to the client in the current conversation.

### getInputHeaders() Method

    public Element[] getInputHeaders()

Returns the SOAP headers that arrived with (1) the current web service invocation message (whether it is a synchronous or asynchronous invocation) or (2) the current callback message. (Note that callbacks are implemented as ordinary method invocations.)

To get the headers included in a synchronous service control invocation, use the getInputHeaders() method on the ServiceControl object: ServiceControl.getInputHeaders().

The SOAP headers used by WebLogic Workshop to manage conversations are included in the list of headers returned.

#### Returns

An array of org.w3c.dom.Element objects containing the SOAP headers that arrived with the current method invocation. Note that JwsContext.getInputHeaders() returns an array of elements. However, with SOAP messages, this method returns a single element. All of the SOAP headers are arranged as a node tree that must be traversed in order to extract the individual headers. Use the org.w3c.dom.Node object to do this. Trying to extract information from more than one element of the array will cause a boundary error.

### getProtocol() Method

    public Protocol getProtocol()

Gets the protocol of the current request.

#### Returns

The protocol of the current request. The Protocol object contains the id number of the protocol as well as a text string with the name of the protocol.

### getUnderstoodInputHeaders() Method

    public boolean getUnderstoodInputHeaders()

Returns the value most recently set by a call to `setUnderstoodInputHeaders```.

#### Returns

The value most recently set by a call to JwsContext.setUnderstoodInputHeaders(); `false` if JwsContext.setUnderstoodInputHeaders() has not been called.

### setCallbackLocation(String) Method

DEPRECATED Supported for backward compatibility only; as of WebLogic Platform 8.1, replaced by `com.bea.control.ServiceControl.setEndPoint(java.net.URL)```.

    public void setCallbackLocation(String url)
         throws MalformedURLException

Specifies the URL to which a web service callback should be sent. Call this method before sending callbacks for conversations with clients that do not implicitly provide callback information via SOAP headers.
You may provide credentials as part of the URL (if supported by the scheme) or by using the setCallbackUsername and setCallbackPassword methods.
The callback location is typically provided by the client in the callbackLocation conversation start SOAP header, but may be set explicitly using this method. The callback location must be set before attempting to send a callback to the client. JwsContext.getCallbackLocation() may be used to retrieve the URL set by this method or to discover the callback URL if it was set via the SOAP header.
Credentials may be provided as part of the URL (if supported by the scheme) or by using the JwsContext.setCallbackUsername() and JwsContext.setCallbackPassword() methods.
Deprecated: JWS callback interfaces should extend ServiceControl, and then ServiceControl.setEndpoint(URL) can be called on a callback instance to set the callback destination.

#### Parameters

url
  The URL to which callbacks should be sent.

#### Exceptions

``MalformedURLException``
  If the URL did not specify a protocol, or if it could not be parsed.

### setCallbackLocation(URL) Method

DEPRECATED Supported for backward compatibility only; as of WebLogic Platform 8.1, replaced by `com.bea.control.ServiceControl.setEndPoint(java.net.URL)```.

    public void setCallbackLocation(URL url)

Specifies the URL to which a web service callback should be sent. Call this method before sending callbacks for conversations with clients that do not implicitly provide callback information via SOAP headers.
You may provide credentials as part of the URL (if supported by the scheme) or by using the setCallbackUsername and setCallbackPassword methods.
The callback location is typically provided by the client in the callbackLocation conversation start SOAP header, but may be set explicitly using this method. The callback location must be set before attempting to send a callback to the client. JwsContext.getCallbackLocation() may be used to retrieve the URL set by this method or to discover the callback URL if it was set via the SOAP header.
Credentials may be provided as part of the URL (if supported by the scheme) or by using the JwsContext.setCallbackUsername() and JwsContext.setCallbackPassword() methods.
Deprecated: JWS callback interfaces should extend ServiceControl, and then ServiceControl.setEndpoint(URL) can be called on a callback instance to set the callback destination.

#### Parameters

url
  The URL to which callbacks should be sent.

### setCallbackPassword(String) Method

DEPRECATED Supported for backward compatibility only; as of WebLogic Platform 8.1, replaced by `com.bea.control.ServiceControl.setPassword(java.lang.String)```.

    public void setCallbackPassword(String password)

Sets the password to use for credentials in callbacks. Use the setCallbackUsername and setCallbackPassword methods if the callback's recipient is secure, and if no credentials were specified in the callback URL.
Overrides the current password if it was specified by the client as part of the callbackLocation conversation start SOAP header.
Deprecated: JWS callback interfaces should extend ServiceControl, and then call ServiceControl.setPassword() on a callback instance.

#### Parameters

password
  The password to use in credentials.

### setCallbackUsername(String) Method

DEPRECATED Supported for backward compatibility only; as of WebLogic Platform 8.1, replaced by `com.bea.control.ServiceControl.setUsername(java.lang.String)```.

    public void setCallbackUsername(String username)

Sets the user name to use for credentials in callbacks. Use the setCallbackUsername and setCallbackPassword methods if the callback's recipient is secure, and if no credentials were specified in the callback URL.
Overrides the current username if it was specified by the client as part of the callbackLocation conversation start SOAP header.
Deprecated: JWS callback interfaces should extend ServiceControl, and then call ServiceControl.setUsername() on a callback instance.

#### Parameters

username
  The user name to use in credentials.

### setOutputHeaders(Element[]) Method

    public void setOutputHeaders(Element[] headers)

Set the SOAP headers to be sent with outgoing messages to the client. Although Element is an array, the headers should be put into a node tree and put in the first element of the Element array.

#### Parameters

headers
  An array of org.w3c.dom.Element objects containing valid SOAP headers.

### setUnderstoodInputHeaders(boolean) Method

    public void setUnderstoodInputHeaders(boolean understood)

Indicates whether input headers were understood. If any input headers are marked with the mustUnderstand attribute value of "1" or "true" and this method is not called with the value `true`, then a SOAP fault will be generated.

#### Parameters

understood
  `true` to indicate that "mustUnderstand" headers were understood; `false` to indicate they weren't.