WebObjects 5.2

com.webobjects.webservices.client
Class WOWebServiceClient

java.lang.Object
  |
  +--com.webobjects.webservices.client.WOWebServiceClient

public class WOWebServiceClient
extends Object

A WOWebServiceClient provides a mechanism for introspecting and invoking Web service operations implemented using SOAP over HTTP. An instance of WOWebServiceClient maps roughly to the contents of a WSDL document: it will manage as many WOWebServices as the WSDL contains SOAP services.


Constructor Summary
WOWebServiceClient(URL aURL)
          Create and initialize an instance of WOWebServiceClient from aURL.
 
Method Summary
 org.apache.axis.EngineConfiguration engineConfigurationForServiceNamed(String serviceName)
          Return the EngineConfiguration being used by the service named serviceName.
 Object invoke(String serviceName, String operationName, Object[] parameters)
          Invoke the operation operationName on the web service serviceName with parameters parameters.
 Class objectTypeForQName(Object aQNameObject)
          Return the object class to which DOM elements with name aQNameObject will be deserialized.
 NSDictionary operationsDictionaryForService(String serviceName)
          Returns an NSDictionary containing a mapping of operation name to WOClientOperation instance for for all operations defined on the Web service named serviceName.
 void registerFactoriesForClassWithQName(org.apache.axis.encoding.SerializerFactory sFactory, org.apache.axis.encoding.DeserializerFactory dFactory, Class aClass, javax.xml.namespace.QName aQname)
          Register aSerializerFactory for serializing objects of class aClass and aDeserializerFactory for deserializing DOM elements with QName aQName.
 NSArray serviceNames()
          Returns the names of all WOWebServices controlled by this client.
 NSMutableDictionary servicesDictionary()
          Returns an NSMutableDictionary containing a mapping of service name to WOWebServices.
 WOWebService.SessionInfo sessionInfoForServiceNamed(String serviceName)
          Return an opaque SessionInfo object which can be used to transfer session information between instances of WOWebService.
 void setEngineConfigurationForServiceNamed(org.apache.axis.EngineConfiguration engineConfig, String serviceName)
          Set the EngineConfiguration to used by the underlying Axis service object used by the service named serviceName.
 void setSecurityDelegateForServiceNamed(Object aDelegate, String serviceName)
          Register aDelegate as the security delegate for the service named serviceName.
 void setSessionInfoForServiceNamed(WOWebService.SessionInfo info, String serviceName)
          Sets the session information for the service named serviceName to the values in info.
 String toString()
           
 Class typeForQName(Object aQnameObject)
          Return the class to which DOM elements with name aQnameObject will be deserialized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WOWebServiceClient

public WOWebServiceClient(URL aURL)
Create and initialize an instance of WOWebServiceClient from aURL. aURL must be a valid URL pointing to a WSDL document describing a Web service.
Parameters:
aURL - URL referring to a WSDL document
Method Detail

engineConfigurationForServiceNamed

public org.apache.axis.EngineConfiguration engineConfigurationForServiceNamed(String serviceName)
Return the EngineConfiguration being used by the service named serviceName. Will return null if there is no service named serviceName, or throw an IllegalArgumentException if serviceName is null.
Parameters:
serviceName - the name of the service whose engine configuration is being requested
Returns:
the org.apache.axis.EngineConfiguration for the receiver

invoke

public Object invoke(String serviceName,
                     String operationName,
                     Object[] parameters)
Invoke the operation operationName on the web service serviceName with parameters parameters. If operationName is a SOAP-RPC call, parameters should be a language array of the parameters expected by the remote method, in the order in which they are to be passed to the method. If operationName is a SOAP document style operation, parameters should contain the Element objects which will form the SOAP body. parameters may be null.

This method may return either an object, or a language array of objects.

Parameters:
serviceName - the name of the service to be called
operationName - the name of the operation to be invoked
parameters - language array of parameters to be used while invoking operationName
Returns:
the value returned by the web service

objectTypeForQName

public Class objectTypeForQName(Object aQNameObject)
Return the object class to which DOM elements with name aQNameObject will be deserialized. Will return null if there is no deserializer registered for aQNameObject. This method always returns an Object class type, not a primitive class.
Parameters:
aQNameObject - a QName
Returns:
the class to which aQNameObject will deserialize, or null
See Also:
typeForQName(java.lang.Object)

operationsDictionaryForService

public NSDictionary operationsDictionaryForService(String serviceName)
Returns an NSDictionary containing a mapping of operation name to WOClientOperation instance for for all operations defined on the Web service named serviceName.
Parameters:
serviceName - String name of service being queried
Returns:
a dictionary of operations

registerFactoriesForClassWithQName

public void registerFactoriesForClassWithQName(org.apache.axis.encoding.SerializerFactory sFactory,
                                               org.apache.axis.encoding.DeserializerFactory dFactory,
                                               Class aClass,
                                               javax.xml.namespace.QName aQname)
Register aSerializerFactory for serializing objects of class aClass and aDeserializerFactory for deserializing DOM elements with QName aQName. Objects serialized by aSerializerFactory will have a QName of aQName. If a aSerializerFactory is null, only aDeserializerFactory will be registered, and vice versa.
Parameters:
aSerializerFactory - factory for creating serializers for Class aClass
aDeserializerFactory - factory for creating deserializers for elements with QName aQName
aClass - Class which aSerializerFactory should be used to serialize
aQName - QName defining elements that aDeserializerFactory should be used to deserialize

serviceNames

public NSArray serviceNames()
Returns the names of all WOWebServices controlled by this client.
Returns:
the names of all services controlled by this client

servicesDictionary

public NSMutableDictionary servicesDictionary()
Returns an NSMutableDictionary containing a mapping of service name to WOWebServices.
Returns:
a dictionary of services

sessionInfoForServiceNamed

public WOWebService.SessionInfo sessionInfoForServiceNamed(String serviceName)
Return an opaque SessionInfo object which can be used to transfer session information between instances of WOWebService. This can be used when invoking multiple Web services on a WebObjects application when a developer wishes to maintain a single session on the server. Will return null if there is no service named serviceName, or throw an IllegalArgumentException if serviceName is null.
Parameters:
serviceName - the name of the service whose SessionInfo should be returned
Returns:
a SessionInfo object
See Also:
setSessionInfoForServiceNamed(com.webobjects.webservices.client.WOWebService.SessionInfo, java.lang.String), WOWebService.sessionInfo(), WOWebService.setSessionInfo(com.webobjects.webservices.client.WOWebService.SessionInfo)

setEngineConfigurationForServiceNamed

public void setEngineConfigurationForServiceNamed(org.apache.axis.EngineConfiguration engineConfig,
                                                  String serviceName)
Set the EngineConfiguration to used by the underlying Axis service object used by the service named serviceName. If the service has already been created, the existing instance will be freed. Will throw an IllegalArgumentException if either engineConfig or serviceName is null.
Parameters:
aConfig - an org.apache.axis.EngineConfiguration
serviceName - the name of the service whose engine configuration is being set

setSecurityDelegateForServiceNamed

public void setSecurityDelegateForServiceNamed(Object aDelegate,
                                               String serviceName)
Register aDelegate as the security delegate for the service named serviceName. Will do nothing if there is no service named serviceName, or throw if serviceName is null.
Parameters:
aDelegate - any object implementing some subset of the WOSecurityDelegate interface
serviceName - the name of the service whose delegate is being set
See Also:
WOSecurityDelegate

setSessionInfoForServiceNamed

public void setSessionInfoForServiceNamed(WOWebService.SessionInfo info,
                                          String serviceName)
Sets the session information for the service named serviceName to the values in info. Will do nothing if there is no service named serviceName. Any existing session information in the service will be overwritten by the values in info.
Parameters:
info - the SessionInfo object from which values should be taken
serviceName - the name of the service
See Also:
sessionInfoForServiceNamed(java.lang.String), WOWebService.sessionInfo(), WOWebService.setSessionInfo(com.webobjects.webservices.client.WOWebService.SessionInfo)

toString

public String toString()
Overrides:
toString in class Object

typeForQName

public Class typeForQName(Object aQnameObject)
Return the class to which DOM elements with name aQnameObject will be deserialized. Will return null if there is no deserializer registered for aQnameObject.
Parameters:
aQnameObject - a QName
Returns:
the class to which aQnameObject will deserialize, or null
See Also:
objectTypeForQName(java.lang.Object)

Last updated Fri Feb 21 13:15:00 PST 2003.

Copyright © 2003 Apple Computer, Inc.