# com.bea.control
ServiceControl Interface

public interface ServiceControl
extends Asynchronous, ServiceProxy, XMLControl

Provides simplified access to web services. A Service control provides an interface between your application and a web service, which allows your application to invoke the methods and handle the callbacks of that web service. Using a Web Service control, you can connect to any web service for which a WSDL file is available, whether or not it was built using WebLogic Workshop.
You typically use a Service control by creating the control from a WSDL file, or from a web service you created with WebLogic Workshop, then add the control to a design in your application. The target web service's operations are exposed as methods of the control.
For more information on using the Service control, see Web Service Control.

All Superinterfaces
  `Control`, `Serializable`,

All Known Subinterfaces
  `ServiceControl`

## Nested Class Summary

`public static interface` | `ServiceControl.Callback` Provides a way for the Service control to pass callback events to its clients.

## Method Summary

`public `String`` | `getConversationID`() Retrieves the conversation ID of the current conversation with this Service control instance.
`public `URL`` | `getEndPoint`() Gets the callback URL that the Service control instance will use as the base URL for callback invocations.
`public `Element`[]` | `getInputHeaders`() Retrieves the SOAP headers that were included in the most recent arriving callback from this Service control.
`public `String`` | `getPassword`() Retrieves the password string that was set by the most recent call to the setPassword method.
`public `Protocol`` | `getProtocol`() Returns a Protocol object representing the protocol to use when sending messages to the target web service.
`public `String`` | `getReliableMessageID`() Retrieves the message ID set for this invocation of the Service control.
`public int` | `getTimeout`() Gets the timeout for HttpURLConnection in milliseconds
`public `String`` | `getUsername`() Retrieves the username string that was set by the most recent call to setUsername.
`public void` | `reset`() Clears all parameters that were set by previous calls to the setConversationID, setOutputHeaders, setPassword, or setUsername methods.
`public void` | `setClientCert`(`String` alias, `String` password) Sets the client certificate alias and password when using client certificates with Secure Sockets Layer (SSL).
`public void` | `setConversationID`(`String` conversationID) Sets the unique key that will be proposed as the conversation ID when initiating a conversation with the Web Service control.
`public void` | `setEndPoint`(`URL` url) Sets the callback URL that the Service control instance will use as the base URL for callback invocations.
`public void` | `setKeystore`(`String` location, `String` password, `String` type) Specifies the keystore information (including type) to use when using client-certificates with Secure Sockets Layer (SSL).
`public void` | `setKeystore`(`String` location, `String` password) Specifies the keystore information to use when using client-certificates with Secure Sockets Layer (SSL).
`public void` | `setOutputHeaders`(`Element`[] headers) Sets the SOAP headers that will be included in the next outgoing method invocation message to the Service control.
`public void` | `setPassword`(`String` password) Sets the password that will be sent with the next outgoing Service control method invocation.
`public void` | `setProtocol`(`Protocol` protocol) Specifies the protocol to use for messages sent to the target web service.
`public void` | `setReliableMessageID`(`String` messageID) Sets the message ID to use for reliable messaging.
`public void` | `setTimeout`(int timeout) Sets the timeout for HttpURLConnection in milliseconds
`public void` | `setUsername`(`String` username) Sets the username that will be sent with the next outgoing Service control method invocation.
`public void` | `useClientKeySSL`(boolean b) Specifies whether a client certificate should be used with Secure Sockets Layer (SSL).

## Method Detail

### getConversationID() Method

    public String getConversationID()

Retrieves the conversation ID of the current conversation with this Service control instance.

#### Returns

The conversation ID for this Service control's current conversation.

### getEndPoint() Method

    public URL getEndPoint()

Gets the callback URL that the Service control instance will use as the base URL for callback invocations.

#### Returns

The callback URL that will be used.

### getInputHeaders() Method

    public Element[] getInputHeaders()

Retrieves the SOAP headers that were included in the most recent arriving callback from this Service control.

#### Returns

An array of the SOAP input header elements for this control's most recently receive callback.

### getPassword() Method

    public String getPassword()

Retrieves the password string that was set by the most recent call to the setPassword method.

#### Returns

The password set by the setPassword method.

### getProtocol() Method

    public Protocol getProtocol()

Returns a Protocol object representing the protocol to use when sending messages to the target web service.

#### Returns

The protocol that will be used.

### getReliableMessageID() Method

    public String getReliableMessageID()

Retrieves the message ID set for this invocation of the Service control. If message delivery fails, you can use this method from within the onDeliverFailure callback to retrieve the message ID that was set using the setReliableMessageID method. Assuming that you have set the message ID to a unique value, you can use this method to identify which invocation of the Service control has failed in the case where there are multiple outstanding requests. Note that this method retrieves a message ID only when the web service is using reliable messaging.

#### Returns

TThe message ID, or null if the message ID has not been set.

### getTimeout() Method

    public int getTimeout()

Gets the timeout for HttpURLConnection in milliseconds

#### Returns

timeout value

### getUsername() Method

    public String getUsername()

Retrieves the username string that was set by the most recent call to setUsername.

#### Returns

The username set by the setUsername method.

### reset() Method

    public void reset()

Clears all parameters that were set by previous calls to the setConversationID, setOutputHeaders, setPassword, or setUsername methods.

### setClientCert(String, String) Method

    public void setClientCert(String alias,
                              String password)

Sets the client certificate alias and password when using client certificates with Secure Sockets Layer (SSL).

#### Parameters

alias
  The client certficate alias.

password
  The client certificate password.

### setConversationID(String) Method

    public void setConversationID(String conversationID)

Sets the unique key that will be proposed as the conversation ID when initiating a conversation with the Web Service control. Note that WebLogic Workshop automatically computes a conversation ID when a WebLogic web service invokes a start method of a Service control. Use the setConversationID method to override the automatic value. The only case where it is useful to do so is if you supply the conversation ID of an existing conversation that is currently ongoing on the target web service. You may then invoke methods on the target service that will execute in the context of the specified conversation. However, only the client that originated the conversation may receive callbacks.

#### Parameters

conversationID
  The new value for the conversation ID.

### setEndPoint(URL) Method

    public void setEndPoint(URL url)

Sets the callback URL that the Service control instance will use as the base URL for callback invocations. While this is set automatically by WebLogic Workshop, you can use this method to override the callback URL if you wish callbacks to be sent to a different destination.

#### Parameters

url
  The new destination for callbacks.

### setKeystore(String, String, String) Method

    public void setKeystore(String location,
                            String password,
                            String type)

Specifies the keystore information (including type) to use when using client-certificates with Secure Sockets Layer (SSL). The default keystore is the WebLogic Server system-identity keystore. Use the type parameters to specify a keystore type other than the default, which is Java KeyStore (JKS).

#### Parameters

location
  The path to the keystore (JKS) file.

password
  The password for the keystore.

type
  The type of keystore to use.

### setKeystore(String, String) Method

    public void setKeystore(String location,
                            String password)

Specifies the keystore information to use when using client-certificates with Secure Sockets Layer (SSL). The keystore type is implied to be "JKS".

#### Parameters

location
  The path to the keystore (JKS) file.

password
  The password for the keystore.

### setOutputHeaders(Element[]) Method

    public void setOutputHeaders(Element[] headers)

Sets the SOAP headers that will be included in the next outgoing method invocation message to the Service control.

#### Parameters

headers
  An array of the new SOAP output header elements.

### setPassword(String) Method

    public void setPassword(String password)

Sets the password that will be sent with the next outgoing Service control method invocation. Used if the Service control uses HTTP basic authentication.

#### Parameters

password
  The password to send for authentication.

### setProtocol(Protocol) Method

    public void setProtocol(Protocol protocol)

Specifies the protocol to use for messages sent to the target web service.

#### Parameters

protocol
  The protocol to use.

### setReliableMessageID(String) Method

    public void setReliableMessageID(String messageID)

Sets the message ID to use for reliable messaging. Use this method to set a unique ID for each invocation on the Service control. This ID can then be used to identify individual method invocations if message delivery fails and the Service control receives the onDeliveryFailure callback. The ID will be received with the callback.
Note that this method sets a message ID for reliable messaging only.

#### Parameters

messageID
  The unique ID to use.

### setTimeout(int) Method

    public void setTimeout(int timeout)

Sets the timeout for HttpURLConnection in milliseconds

### setUsername(String) Method

    public void setUsername(String username)

Sets the username that will be sent with the next outgoing Service control method invocation. Used if the Service control uses HTTP basic authentication.

#### Parameters

username
  The username to send for authentication.

### useClientKeySSL(boolean) Method

    public void useClientKeySSL(boolean b)

Specifies whether a client certificate should be used with Secure Sockets Layer (SSL).

#### Parameters

b
  `true` to use a client certificate; otherwise, `false`.