org.licas.ws

## Class WsFactory

- java.lang.Object
- - org.licas.ws.WsFactory

- Direct Known Subclasses:
    LicasWsFactory

      public abstract class WsFactory
      extends java.lang.Object

  Factory object for web services. You must set an instance of this in your main program using the `setInstance` method. Your instance should extend `Soap_BaseHandler`.
  Author:
    Kieran Greer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WsFactory()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `addPrefix(java.lang.String prefix, java.lang.String value)` Return the String value with the namespace prefix removed.
    `abstract WsMethodInfo` | `createSoapCall(java.lang.String operationName, boolean setRtn, boolean paramValues, LicasWsdlModel lWsdlModel)` Create and return a method info object for invoking a web service using the SOAP protocol.
    `abstract WsMethodInfo` | `createSoapCall(java.lang.String webService, java.lang.String operation, java.lang.String endpointAddress, java.lang.String soapActionUri, java.lang.String namespace, java.util.ArrayList<WsdlParamInfo> parameters, boolean setRtn)` Create and return a method info object for invoking a web service using the SOAP protocol.
    `abstract Soap_BaseHandler` | `createSoapMethodHandler()` Create the client soap method handler.
    `static WsFactory` | `getInstance()` Get the web service factory instance.
    `static boolean` | `hasInstance()` Return true if an instance of the factory has been set.
    `static java.lang.String` | `removePrefix(java.lang.String value)` Return the String value with the namespace prefix removed.
    `static void` | `setInstance(WsFactory thisInstance)` Set the web service factory instance if null.
    `static WsMethodInfo` | `toMethodInfo(MethodInfo methodInfo)` Convert the method info into a Web-Service type equivalent.
    `abstract WsMethodInfo` | `toMethodInfo(java.lang.String method, java.lang.String descr)` Required by some string-based requests, to convert them back into the method info object.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### WsFactory

          public WsFactory()

  - ### Method Detail

    - #### hasInstance

          public static boolean hasInstance()

      Return true if an instance of the factory has been set.
      Returns:
        true if instance is not null.

    - #### setInstance

          public static void setInstance(WsFactory thisInstance)

      Set the web service factory instance if null.
      Parameters:
        `thisInstance` - the factory instance.

    - #### getInstance

          public static WsFactory getInstance()

      Get the web service factory instance.
      Returns:
        the value of instance.

    - #### createSoapCall

          public abstract WsMethodInfo createSoapCall(java.lang.String operationName,
                                                      boolean setRtn,
                                                      boolean paramValues,
                                                      LicasWsdlModel lWsdlModel)
                                               throws java.lang.Exception

      Create and return a method info object for invoking a web service using the SOAP protocol.
      Parameters:
        `operationName` - the name of the operation to call.
        `setRtn` - true if set the return Object type.
        `paramValues` - if true add the parameter values as `WsdlParamInfo` objects.
        `lWsdlModel` - the wsdl model that stores the description.
      Returns:
        a web service info object with the appropriate values.
      Throws:
        `java.lang.Exception` - any error.

    - #### createSoapCall

          public abstract WsMethodInfo createSoapCall(java.lang.String webService,
                                                      java.lang.String operation,
                                                      java.lang.String endpointAddress,
                                                      java.lang.String soapActionUri,
                                                      java.lang.String namespace,
                                                      java.util.ArrayList<WsdlParamInfo> parameters,
                                                      boolean setRtn)
                                               throws java.lang.Exception

      Create and return a method info object for invoking a web service using the SOAP protocol.
      Parameters:
        `webService` - the service name.
        `operation` - the name of the operation to call.
        `endpointAddress` - the server endpoint address.
        `soapActionUri` - soap action uri type.
        `namespace` - ontology namespace.
        `parameters` - list of `WsdlParamInfo` objects that store parameter types and values.
        `setRtn` - true if set the return Object type.
      Returns:
        a web service info object with the appropriate values.
      Throws:
        `java.lang.Exception` - any error.

    - #### createSoapMethodHandler

          public abstract Soap_BaseHandler createSoapMethodHandler()

      Create the client soap method handler.
      Returns:
        a soap handler derived from `Soap_BaseHandler`.

    - #### toMethodInfo

          public abstract WsMethodInfo toMethodInfo(java.lang.String method,
                                                    java.lang.String descr)
                                             throws java.lang.Exception

      Required by some string-based requests, to convert them back into the method info object. A script might require parsing from a string, for example.
      Parameters:
        `method` - the method name.
        `descr` - the method call description.
      Returns:
        the related method info object.
      Throws:
        `java.lang.Exception` - any error.

    - #### toMethodInfo

          public static WsMethodInfo toMethodInfo(MethodInfo methodInfo)
                                           throws java.lang.Exception

      Convert the method info into a Web-Service type equivalent.
      Parameters:
        `methodInfo` - the method info to convert.
      Returns:
        the same information in a WsMethodInfo object.
      Throws:
        `java.lang.Exception` - any error.

    - #### addPrefix

          public static java.lang.String addPrefix(java.lang.String prefix,
                                                   java.lang.String value)

      Return the String value with the namespace prefix removed.
      Parameters:
        `prefix` - the namespace prefix.
        `value` - the value for which the prefix should be removed
      Returns:
        the value with the namespace prefix removed

    - #### removePrefix

          public static java.lang.String removePrefix(java.lang.String value)

      Return the String value with the namespace prefix removed.
      Parameters:
        `value` - the value for which the prefix should be removed
      Returns:
        the value with the namespace prefix removed