com.bea.control.classic
Interface ServiceControl

All Superinterfaces:
ServiceProxy
All Known Subinterfaces:
B2BCallback, B2BCallbackControl, com.bea.wli.knex.runtime.core.control.ExtendedServiceControl, ServiceBrokerControl

public interface ServiceControl
extends ServiceProxy

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. TODO: this package should be renamed to avoid conflict with WLW controls. We still need to decide whether TODO: WLW or WLI should rename it. WLW does not support the old 8.1 interface, so they should certainly fix it TODO: or rename their packages if they do not want to break 8.1 user code.


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

Method Detail

setEndPoint

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.

getEndPoint

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.

setConversationID

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.

getConversationID

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.

setProtocol

void setProtocol(Protocol protocol)
Specifies the protocol to use for messages sent to the target web service.

Parameters:
protocol - The protocol to use.

getProtocol

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.

setReliableMessageID

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.

getReliableMessageID

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.

setUsername

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.

setPassword

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.

getUsername

String getUsername()
Retrieves the username string that was set by the most recent call to setUsername

Returns:
The username set by the setUsername method.

getPassword

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.

useClientKeySSL

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.

setKeystore

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

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.

setClientCert

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.

getInputHeaders

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.

setOutputHeaders

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.

reset

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


setTimeout

void setTimeout(int timeout)
Sets the timeout for HttpURLConnection in milliseconds

Parameters:
timeout -

getTimeout

int getTimeout()
Gets the timeout for HttpURLConnection in milliseconds

Returns:
timeout value