| Oracle9i XML API Reference - XDK and Oracle XML DB Release 2 (9.2) Part Number A96616-01 |
|
Oracle SOAP is an implementation of the Simple Object Access Protocol. Oracle SOAP is based on the SOAP open source implementation developed by the Apache Software Foundation.
SOAP is a transport protocol for sending and receiving requests and responses across the Internet. It is based on XML and HTTP. SOAP is transport protocol-independent and operating system-independent. It provides the standard XML message format for all applications. SOAP uses the XML Schema standard of the World Wide Web Consortium (W3C).
Oracle SOAP APIs are contained in these packages and classes:
Package oracle.soap.server contains the interfaces and classes that implement the API for SOAP administrative clients and the provider implementation for Java classes. These include the Service Manager and the Provider Manager. These administrative clients are services that support dynamic deployment of new services and new providers.
Table 11-1 lists the interfaces and classes that provide support for Oracle SOAP in the XDK for Java.
Handler defines the interface for a pluggable handler in the SOAP server. This class does not imply any policies about when the handler in invoked.
A handler implementation must:
oracle.soap.server.Handler public interface Handler
Cleans-up handler (one time only). This method will be invoked by the SOAP server exactly once before the server shuts down. This gives the handler the opportunity to do cleanup of global state. Throws SOAPException if unable to destroy.
public abstract void destroy();
Returns this handler's name.
public abstract String getName();
Returns options that are specific to the handler implementation.
public abstract Properties getOptions();
Initializes handler (one-time only). This method will be invoked by the SOAP server exactly once before the server makes any invocations on the handler, allowing the handler to set up any global state. It uses any options that were set previously through setOptions(). Throws SOAPException if unable to initialize the handler.
public abstract void init( SOAPServerContext ssc);
| Parameter | Description |
|---|---|
|
ssc |
The SOAP server context, which contains the logger for informational messages. |
Invokes the requested handler as part of the specified chain type. Note that execution of a chain of request handlers or response handlers will terminate immediately if any handler throws a SOAPException. In contrast, all handlers in an error chain will be invoked, regardless of whether or not any handler throws an exception. In the case of an exception in an error handler, the exception is logged and discarded. Throws SOAPException if handler invocation failed.
public abstract void invoke( int chainType, RequestContext requestContext);
Sets the name of the handler. This method must be called before init().
public abstract void setName( String name);
| Parameter | Description |
|---|---|
|
name |
The name of the handler instance. |
Sets the options for the handler for subsequent use by init. This method must be called before init().
public abstract void setOptions( Properties options);
| Parameter | Description |
|---|---|
|
options |
Options that are specific to the handler implementation. |
Provider defines the capabilities that must be supported for each type of service provider, such as Java class or stored procedure. Providers are responsible for service authorization, and parameter unmarshalling/marshalling.
Providers, aka provider instances, must be deployed to the SOAP handler. Each provider deployment must define the provider name, Java classname that implements the provider (which must be an implementation of this interface), and any number of provider-specific key-value pairs. Given the provider deployment information, the SOAP handler will interact with the providers solely through this interface.
The SOAP handler will create one instance for each deployed provider instance. It is possible to have one or more instances of each provider implementation (which is not to say that is necessarily recommended). In any event, each instance of a provider must be able to handle requests concurrently.
A provider implementation must:
public interface Provider
Interface oracle.soap.server.Provider
Cleans up provider instance (one time only). This method will be invoked by the SOAP handler exactly once before the handler shuts down. This gives the provider the opportunity to do cleanup of provider-global state. Throws SOAPException if unable to destroy.
public abstract void destroy();
Returns this providers name, which is unique within the SOAP handler.
public abstract String getId();
Initializes provider instance (one time only). This method will be invoked by the SOAP handler exactly once before the handler makes any requests to services supported by the provider, allowing the provider to set up any provider-global context. Throws SOAPException if unable to initialize and therefore unable to provide services.
public abstract void init( ProviderDeploymentDescriptor pd, SOAPServerContext ssc);
| Parameter | Description |
|---|---|
|
pd |
The provider descriptor which contains the provider deployment information. |
|
ssc |
The SOAP server context, which contains the logger for informational messages. |
Invokes the requested method in the specified service, where the SOAP request is completely described in the request context. Throws SOAPException if error during method invocation for any number of reasons, including user does not have permission, method does not exist.
public abstract void invoke( RequestContext requestContext);
| Parameter | Description |
|---|---|
|
requestContext |
The RequestContext that contains everything the provider needs to process the request. |
Provider Manager defines the interface to manage providers. The provider manager is used by the SOAP engine to deploy providers, undeploy providers, and access provider deployment information. The provider manager may cache deployment information and is responsible to maintain the cache.
The HTTP server provides security for the provider manager. The provider manager can be configured with a URL that requests must be made to in order for the request to be accepted. If a SOAP request for the provider manager is made to any other URL, the request will be rejected. This URL should be an alias to the SOAP servlet, and HTTP security can be set to control which users can post to the URL.
public interface ProviderManager Interface oracle.soap.server.ProviderManager
Deploys the given provider. Throws SOAPException if unable to deploy.
public abstract void deploy(ProviderDeploymentDescriptor providerId);
| Parameter | Description |
|---|---|
|
providerId |
The id of the provider to deploy. |
Cleans up the provider manager. Throws SOAPException if unable to cleanup the provider manager.
public abstract void destroy();
Returns the URI that provider manager requests, or NULL if any URI can be used. Request must be made to in order to be accepted. Requests made to any other URI must be rejected.
public abstract String getRequiredRequestURI();
Initializes the provider manager. Throws SOAPException if unable to access the deployment information.
public abstract void init(Properties options);
| Parameter | Description |
|---|---|
|
options |
The options required to setup access to the deployment information. |
Returns an array of provider ids for all providers that have been deployed. Throws SOAPException if unable to list provider ids.
public abstract String[] list();
Returns the deployment descriptor for the given provider. Throws SOAPException if the provider is not found.
public abstract ProviderDeploymentDescriptor query( String providerId);
| Parameter | Description |
|---|---|
|
providerId |
The id of the provider. |
Makes the service manager that is being used to manage service deployment information available to the provider manager. The provider manager may use the service manager to ensure that a provider is not undeployed as long as any services are deployed under that provider.
public abstract void setServiceManager( ServiceManager serviceManager);
| Parameter | Description |
|---|---|
|
providerManager |
The provider manager that is managing provider deployment information for the SOAP server. |
Undeploys the given provider, and returns its descriptor containing the deployment information for the provider that has been undeployed. Throws SOAPException if the provider is not found or failed to undeploy.
public abstract ProviderDeploymentDescriptor undeploy( String providerId);
| Parameter | Description |
|---|---|
|
providerId |
The id of the provider to undeploy. |
Service Manager defines the interface to manage services. The Service Manager is used by the SOAP engine to deploy services, undeploy services, and to access service deployment information. The Service Manager may cache deployment information and is responsible for maintaining the cache.
The HTTP server provides security for the service manager. The service manager can be configured with a URL that requests must be made to in order for the request to be accepted. If a SOAP request for the service manager is made to any other URL, the request will be rejected. This URL should be an alias to the SOAP servlet, and HTTP security can be set to control which users can post to the specified URL.
public interface ServiceManager Interface oracle.soap.server.ServiceManager
Returns the URI that service manager requests, or NUKLL if any URI can be used. Requests must be made to in order to be accepted. Requests made to any other URI must be rejected.
public abstract String getRequiredRequestURI();
Deploys the given service. Throws SOAPException if unable to deploy.
public abstract void deploy(ServiceDeploymentDescriptor sd);
| Parameter | Description |
|---|---|
|
sd |
The service descriptor for the service to deploy. |
Cleans up the service manager. Throws SOAPException if unable to cleanup the service manager.
public abstract void destroy();
Initializes the service manager. The implementation should be able to handle a null value for the provider manager. Throws SOAPException if unable to access the service deployment information.
public abstract void init( Properties options, ProviderManager providerManager);
Returns an array of service ids for all services that have been deployed, regardless of the provider. Throws SOAPException if unable to list service ids.
public abstract String[] list();
Returns the deployment descriptor for the given service. Throws SOAPException if the service is not found.
public abstract ServiceDeploymentDescriptor query( String serviceId);
| Parameter | Description |
|---|---|
|
serviceId |
The unique URI of the service. |
Undeploys the given service, and returns its descriptor. Throws SOAPException if the service is not found or failed to undeploy.
public abstract ServiceDeploymentDescriptor undeploy( String serviceId);
| Parameter | Description |
|---|---|
|
serviceId |
The URI of the service to undeploy. |
ContainerContext class defines the context of the container in which the SOAP server is running. The actual content depends on the environment in which the server is running, such as in a servlet engine. This class should contain only container-specific content.
public class ContainerContext extends Object java.lang.Object | +----oracle.soap.server.ContainerContext
| Field | Syntax | Description |
|---|---|---|
|
SERVLET_CONTAINER |
SERVLET_CONTAINER |
The value for a servlet container type. |
Class constructor.
public ContainerContext();
Returns the attribute with the given name, or NULL if there is no attribute by that name.
public Object getAttribute( String name);
| Parameter | Description |
|---|---|
|
name |
A String specifying the name of the attribute. |
Returns an Enumeration containing the attribute names available within this SOAP context.
public Enumeration getAttributeNames();
Returns the container type in which the SOAP server is running.
public String getContainerType();
Returns the HTTP servlet that is processing the SOAP request if the container type is SERVLET_CONTAINER, or NULL if the servlet attribute is not set.
public HttpServlet getHttpServlet();
Removes the attribute with the given name from the context. After removal, subsequent calls to getAttribute(java.lang.String) to retrieve the attribute's value will return NULL.
public void removeAttribute( String name);
| Parameter | Description |
|---|---|
|
name |
A String specifying the name of the attribute to be removed. |
Binds an object to a given attribute name in this SOAP context. If the name specified is already used for an attribute, this method will remove the old attribute and bind the name to the new attribute. Neither the name nor the object may be NULL.
public void setAttribute( String name, Object object);
| Parameter | Description |
|---|---|
|
name |
A non-null String specifying the name of the attribute. |
|
object |
An non-null Object representing the attribute to be bound. |
Sets the container type.
public void setContainerType( String containerType);
| Parameter | Description |
|---|---|
|
containerType |
The type of container in which the SOAP server is running. |
Sets the HTTP servlet for a SOAP server running in a SERVLET_CONTAINER type of container.
public void setHttpServlet(HttpServlet servlet);
| Parameter | Description |
|---|---|
|
servlet |
The HttpServlet that is processing the SOAP request. |
Logger defines the capabilities that must be supported by a logger implementation. The logger is used to persistently record error and informational messages.
Each log request specifies the severity, and the information should be logged iff the severity is at least as high as the specified severity.
The order of severity in increasing order is:
For example, if the severity is set to SEVERITY_STATUS, any log request with severity of either SEVERITY_STATUS or SEVERITY_ERROR will be logged.
Class oracle.soap.server.Logger public abstract class Logger extends Object java.lang.Object | +----oracle.soap.server.Logger
Class constructor.
public Logger();
Returns the current severity setting for the logger.
public int getSeverity();
Returns the severity name associated with the given severity.
protected final String getSeverityName( int severity);
| Parameter | Description |
|---|---|
|
severity |
The severity level ( |
Returns the severity value associated with the given severity name.
protected final int getSeverityValue( String severityName);
| Parameter | Description |
|---|---|
|
severityName |
The name of the severity level, such as error. |
Initializes of the logger (one-time only) with its configuration parameters. Throws SOAPException if unable to initialize the logger.
public abstract void init( Properties options, ContainerContext context);
Determines if a message would be logged at the given severity level. Returns TRUE if a message would be logged at the given severity level, FALSE otherwise.
public boolean isLoggable( int severity);
| Parameter | Description |
|---|---|
|
severity |
The severity level to check. |
Logs messages. The options are described in the following table.
| Parameter | Description |
|---|---|
|
msg |
The message to log. |
|
severity |
The severity at which to log the information. |
|
t |
The throwable exception to log. |
Sets the current severity.
public void setSeverity(int severity);
| Parameter | Description |
|---|---|
|
severity |
The new severity setting for the logger. |
ProviderDeploymentDescriptor defines the deployment information for a specific provider. Different providers may be deployed using the same implementation and be distinguished only by their provider descriptor.
public final class ProviderDeploymentDescriptor extends Object implements Serializable java.lang.Object | +----oracle.soap.server.ProviderDeploymentDescriptor
Constructs a new instance of a provider descriptor.
public ProviderDeploymentDescriptor();
Builds and returns a provider descriptor from the given XML document.
public static ProviderDeploymentDescriptor fromXML( Element root);
| Parameter | Description |
|---|---|
|
root |
The root of the document that represents the XML provider descriptor. |
Returns the name of the class that implements this provider.
public String getClassname();
Returns the unique id for this provider.
public String getId();
Returns the provider-specific options, or value pairs that represent the provider-specific options for this service.
public Hashtable getOptions();
Returns the provider type.
public String getProviderType();
Sets the name of the class that implements this provider.
public void setClassname( String classname);
| Parameter | Description |
|---|---|
|
classname |
The name of the implementing class. |
Sets the provider id.
public void setId( String id);
| Parameter | Description |
|---|---|
|
id |
The unique provider id. |
Sets the options.
public void setOptions( Hashtable options);
| Parameter | Description |
|---|---|
|
options |
The name-value pairs that represent the provider implementation-specific options for this service. |
Sets the provider type.
public void setProviderType( String providerType);
| Parameter | Description |
|---|---|
|
providerType |
The provider type. |
Writes out the service deployment descriptor to String.
public String toString();
Writes out the service deployment descriptor as XML.
public void toXML( Writer pr);
| Parameter | Description |
|---|---|
|
pr |
The writer for the XML output. |
RequestContext defines all of the context for a SOAP request, including information that is passed to the provider and information that the provider must set before returning. Note that the provider is given the request Envelope and is therefore responsible to unmarshall the request parameters. Similarly, the provider is required to marshall the response, although the response envelope must also be set by the provider, as it may be needed by a pluggable handler. The following information is provided by the SOAP engine to the Provider, meaning that the provider can utilize this information in Provider.invoke():
getEnvelope - the envelope containing the requestgetServiceDeploymentDescriptor - the service deployment descriptor for the service in which the method is being invokedgetServiceId - the URI of the servicegetUserContext - the security context describing the user invoking the method in the servicegetMethodName - the name of the method being invoked in the service.The following information must be given by the Provider to the SOAP engine:
setResponseBytes - this is the marshalled response. Given a Response, it can be created by building the response envelope and then marshalling the envelope.setResponseEnvelope - this is the response envelope, which is logically equivalent to the response bytes.getRequestEncodingStyle - the encoding style to use for the response in case of an error (if not set, defaults to Constants.NS_URI_SOAP_ENC, which is SOAP encoding). If the provider cares about this, it should set this value as soon as it can in case of an exception. The provider might use the same encoding as the reques