org.apache.beehive.controls.system.webservice
Interface ServiceControl


public interface ServiceControl

Provides simplified access to web services. A service control provides an interface between an application and a web service, which allows an application to invoke the service's operations. Using a web service control, you can connect to any web service for which a WSDL file is available.

Typically, a service control is used by creating the control from a WSDL file. Then, the target web service's operations are exposed as methods of the control.


Nested Class Summary
static interface ServiceControl.Location
          Location URL for target service.
static interface ServiceControl.OperationName
          OperationName is only used when the target WSDL defines operations with names that are invalid as Java Method names.
static interface ServiceControl.WSDL
          Path to WSDL - required annotation.
 
Method Summary
 URL getEndPoint()
          Gets the URL that the Service control instance will use as the base URL.
 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.
 int getTimeout()
          Gets the timeout that has been set by setTimeout() for the underlying HttpURLConnection (returned in millisecs, a value of 0 means no timeout).
 String getUsername()
          Retrieves the username string that was set by the most recent call to setUsername.
 QName getWsdlPort()
          Returns the QName of the port that will be used by the Service Control to call the webservice.
 void reset()
          Clears all parameters that were set by previous calls to the setOutputHeaders, setPassword, or setUsername methods.
 void setEndPoint(URL url)
          Manual control over URL of the target service.
 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 setTimeout(int timeout)
          Sets the timeout for the underlying HttpURLConnection (in millisecs, default is 0 which means no timeout, negative values are converted to 0).
 void setUsername(String username)
          Sets the username that will be sent with the next outgoing Service control method invocation.
 void setWsdlPort(QName wsdlPortName)
          Specifies the QName for the port within the WSDL which the Service Control should use.
 

Method Detail

setEndPoint

void setEndPoint(URL url)
Manual control over URL of the target service.

Parameters:
url - The new destination for callbacks.

getEndPoint

URL getEndPoint()
Gets the URL that the Service control instance will use as the base URL.

Returns:
The URL that will be used.

setWsdlPort

void setWsdlPort(QName wsdlPortName)
Specifies the QName for the port within the WSDL which the Service Control should use.

Parameters:
wsdlPortName - The QName of the port to use.

getWsdlPort

QName getWsdlPort()
Returns the QName of the port that will be used by the Service Control to call the webservice.

Returns:
The QName of the port that will be used.

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.

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.

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.

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.

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.

setTimeout

void setTimeout(int timeout)
Sets the timeout for the underlying HttpURLConnection (in millisecs, default is 0 which means no timeout, negative values are converted to 0).


getTimeout

int getTimeout()
Gets the timeout that has been set by setTimeout() for the underlying HttpURLConnection (returned in millisecs, a value of 0 means no timeout).


reset

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