Class AxisService

    • Field Detail

      • SUPPORT_SINGLE_OP

        public static final String SUPPORT_SINGLE_OP
        If this param is true, and the service has exactly one AxisOperation, normal operation dispatch (via URI/soapAction/etc) will not be necessary, and we'll just default to funneling all messages to that op. This is useful for passthrough/ESB/embedded applications.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AxisService

        public AxisService()
        Constructor AxisService.
      • AxisService

        public AxisService​(String name)
        Constructor AxisService.
    • Method Detail

      • isSchemaLocationsAdjusted

        public boolean isSchemaLocationsAdjusted()
      • setSchemaLocationsAdjusted

        public void setSchemaLocationsAdjusted​(boolean schemaLocationsAdjusted)
      • getSchemaMappingTable

        public Map getSchemaMappingTable()
      • setSchemaMappingTable

        public void setSchemaMappingTable​(Map schemaMappingTable)
      • getCustomSchemaNamePrefix

        public String getCustomSchemaNamePrefix()
      • setCustomSchemaNamePrefix

        public void setCustomSchemaNamePrefix​(String customSchemaNamePrefix)
      • getCustomSchemaNameSuffix

        public String getCustomSchemaNameSuffix()
      • setCustomSchemaNameSuffix

        public void setCustomSchemaNameSuffix​(String customSchemaNameSuffix)
      • getBindingName

        public String getBindingName()
      • setBindingName

        public void setBindingName​(String bindingName)
      • getSoapNsUri

        public String getSoapNsUri()
        get the SOAPVersion
      • setSoapNsUri

        public void setSoapNsUri​(String soapNsUri)
      • getEndpointName

        public String getEndpointName()
        get the endpointName
      • setEndpointName

        public void setEndpointName​(String endpoint)
      • addMessageReceiver

        public void addMessageReceiver​(String mepURI,
                                       MessageReceiver messageReceiver)
      • addModuleConfig

        public void addModuleConfig​(ModuleConfiguration moduleConfiguration)
        Adds module configuration , if there is moduleConfig tag in service.
        Parameters:
        moduleConfiguration -
      • addModuleref

        public void addModuleref​(String moduleref)
      • addExcludeOperationName

        public void addExcludeOperationName​(String operation)
        Adds operation name to exclude list.
        Parameters:
        operation - operation name to add to exclude list
      • removeExcludeOperationName

        public void removeExcludeOperationName​(String operation)
        Removes operation name from exclude list.
        Parameters:
        operation - operation name to remove from exclude list
      • isExcludedOperation

        public boolean isExcludedOperation​(String operation)
        Returns whether operation name is in exclude list.
        Parameters:
        operation - name to check if operation is in the exlude list.
        Returns:
        boolean indicating whether operation name is in exlude list.
      • addOperation

        public void addOperation​(AxisOperation axisOperation)
        Method addOperation.
        Parameters:
        axisOperation -
      • mapActionToOperation

        public void mapActionToOperation​(String action,
                                         AxisOperation axisOperation)
        Maps an alias (such as a SOAPAction, WSA action, or an operation name) to the given AxisOperation. This is used by dispatching (both SOAPAction- and WSAddressing- based dispatching) to figure out which operation a given message is for. Some notes on restrictions of "action" - A null or empty action will be ignored - An action that is a duplicate and references an idential operation is allowed - An acton that is a duplicate and references a different operation is NOT allowed. In this case, the action for the original operation is removed from the alias table, thus removing the ability to route based on this action. This is necessary to prevent mis-directing incoming message to the wrong operation based on SOAPAction. Note that an alias could be a SOAPAction, WS-Addressing Action, the operation name, or some other alias.
        Parameters:
        action - the alias key
        axisOperation - the operation to map to
        See Also:
        getOperationByAction(String)
      • addHttpLocationDispatcherString

        public void addHttpLocationDispatcherString​(String string,
                                                    AxisOperation axisOperation)
        Maps an constant string in the whttp:location to the given operation. This is used by RequestURIOperationDispatcher based dispatching to figure out which operation it is that a given message is for.
        Parameters:
        string - the constant drawn from whttp:location
        axisOperation - the operation to map to
      • printSchema

        public void printSchema​(OutputStream out)
                         throws AxisFault
        Prints the schema to the given output stream.
        Parameters:
        out - The output stream for the data to be written. NOTE: the stream is not closed after the operation, it is the responsibility of the caller to close the stream after usage.
        Throws:
        AxisFault
      • getSchema

        public org.apache.ws.commons.schema.XmlSchema getSchema​(int index)
      • releaseSchemaList

        public void releaseSchemaList()
        Release the list of schema objects.

        In some environments, this can provide significant relief of memory consumption in the java heap, as long as the need for the schema list has completed.

      • setEPRs

        public void setEPRs​(String[] eprs)
      • getEPRs

        public String[] getEPRs()
      • printUserWSDL

        public void printUserWSDL​(OutputStream out,
                                  String wsdlName,
                                  String ip)
                           throws AxisFault
        Prints the user WSDL.
        Parameters:
        out - The output stream for the data to be written. NOTE: the stream is not closed after the operation, it is the responsibility of the caller to close the stream after usage.
        wsdlName - The name of the WSDL.
        ip - The host IP address.
        Throws:
        AxisFault
      • printXSD

        public int printXSD​(OutputStream out,
                            String xsd)
                     throws IOException
        Produces a XSD for this AxisService and prints it to the specified OutputStream.
        Parameters:
        out - destination stream, NOTE: the stream is not closed after the operation, it is the responsibility of the caller to close the stream after usage.
        xsd - schema name
        Returns:
        -1 implies not found, 0 implies redirect to root, 1 implies found/printed a schema
        Throws:
        IOException
      • printWSDL

        public void printWSDL​(OutputStream out,
                              String requestIP)
                       throws AxisFault
        Produces a WSDL for this AxisService and prints it to the specified OutputStream.
        Parameters:
        out - destination stream. The WSDL will be sent here. NOTE: the stream is not closed after the operation, it is the responsibility of the caller to close the stream after usage.
        requestIP - the hostname the WSDL request was directed at. This should be the address that appears in the generated WSDL.
        Throws:
        AxisFault - if an error occurs
      • isSetEndpointsToAllUsedBindings

        public boolean isSetEndpointsToAllUsedBindings()
        users can use this parameter when they supply a wsdl file with the .aar file but wants to generate the endpoints for all available transports. here it assume that the user has not set the useOriginalwsdl
        Returns:
      • printWSDL

        public void printWSDL​(OutputStream out)
                       throws AxisFault
        Print the WSDL with a default URL. This will be called only during codegen time.
        Parameters:
        out - The output stream for the data to be written. NOTE: the stream is not closed after the operation, it is the responsibility of the caller to close the stream after usage.
        Throws:
        AxisFault
      • printWSDL2

        public void printWSDL2​(OutputStream out)
                        throws AxisFault
        Print the WSDL2.0 with a default URL. This will be called only during codegen time.
        Parameters:
        out - The output stream for the data to be written for. NOTE: the stream is not closed after the operation, it is the responsibility of the caller to close the stream after usage.
        Throws:
        AxisFault
      • printWSDL2

        public void printWSDL2​(OutputStream out,
                               String requestIP)
                        throws AxisFault
        Prints WSDL2.0 data for the service with the given host IP address.
        Parameters:
        out - The output stream for the data to be written for. NOTE: the stream is not closed after the operation, it is the responsibility of the caller to close the stream after usage.
        requestIP - The host IP address.
        Throws:
        AxisFault
      • printWSDL2

        public int printWSDL2​(OutputStream out,
                              String requestIP,
                              String wsdl)
                       throws IOException,
                              AxisFault
        Produces a WSDL2 for this AxisService and prints it to the specified OutputStream.
        Parameters:
        out - destination stream. NOTE: the stream is not closed after the operation, it is the responsibility of the caller to close the stream after usage.
        wsdl - wsdl name
        Returns:
        -1 implies not found, 0 implies redirect to root, 1 implies found/printed wsdl
        Throws:
        IOException
        AxisFault
      • getClassLoader

        public ClassLoader getClassLoader()
        Method getClassLoader.
        Returns:
        Returns ClassLoader.
      • getControlOperations

        public ArrayList<AxisOperation> getControlOperations()
        Gets the control operation which are added by module like RM.
      • getFileName

        public URL getFileName()
      • getLastUpdate

        public long getLastUpdate()
      • getName

        public String getName()
      • getOperation

        public AxisOperation getOperation​(QName operationName)
        Method getOperation.
        Parameters:
        operationName -
        Returns:
        Returns AxisOperation.
      • getOperationByAction

        public AxisOperation getOperationByAction​(String action)
        Returns the AxisOperation which has been mapped to the given alias.
        Parameters:
        action - the alias key
        Returns:
        Returns the corresponding AxisOperation or null if it isn't found.
        See Also:
        mapActionToOperation(String, AxisOperation)
      • getOperationBySOAPAction

        public AxisOperation getOperationBySOAPAction​(String soapAction)
        Returns the operation given a SOAP Action. This method should be called if only one Endpoint is defined for this Service. If more than one Endpoint exists, one of them will be picked. If more than one Operation is found with the given SOAP Action; null will be returned. If no particular Operation is found with the given SOAP Action; null will be returned. If the action is in the list of invaliad aliases, which means it did not uniquely identify an operation, a null will be returned.
        Parameters:
        soapAction - SOAP Action defined for the particular Operation
        Returns:
        Returns an AxisOperation if a unique Operation can be found with the given SOAP Action otherwise will return null.
      • getOperations

        public Iterator<AxisOperation> getOperations()
        Method getOperations.
        Returns:
        Returns HashMap
      • getPublishedOperations

        public ArrayList<AxisOperation> getPublishedOperations()
        Gets only the published operations.
      • setClassLoader

        public void setClassLoader​(ClassLoader classLoader)
        Method setClassLoader.
        Parameters:
        classLoader -
      • setFileName

        public void setFileName​(URL fileName)
      • setLastUpdate

        public void setLastUpdate()
        Sets the current time as last update time of the service.
      • setName

        public void setName​(String name)
      • getSchema

        public ArrayList<org.apache.ws.commons.schema.XmlSchema> getSchema()
      • addSchema

        public void addSchema​(org.apache.ws.commons.schema.XmlSchema schema)
      • addSchema

        public void addSchema​(Collection<org.apache.ws.commons.schema.XmlSchema> schemas)
      • isWsdlFound

        public boolean isWsdlFound()
      • setWsdlFound

        public void setWsdlFound​(boolean wsdlFound)
      • getScope

        public String getScope()
      • setScope

        public void setScope​(String scope)
        Parameters:
        scope - - Available scopes : Constants.SCOPE_APPLICATION Constants.SCOPE_TRANSPORT_SESSION Constants.SCOPE_SOAP_SESSION Constants.SCOPE_REQUEST.equals
      • isUseDefaultChains

        public boolean isUseDefaultChains()
      • setUseDefaultChains

        public void setUseDefaultChains​(boolean useDefaultChains)
      • isActive

        public boolean isActive()
      • setActive

        public void setActive​(boolean active)
      • getSchemaTargetNamespace

        public String getSchemaTargetNamespace()
      • setSchemaTargetNamespace

        public void setSchemaTargetNamespace​(String schematargetNamespace)
      • getSchemaTargetNamespacePrefix

        public String getSchemaTargetNamespacePrefix()
      • setSchemaTargetNamespacePrefix

        public void setSchemaTargetNamespacePrefix​(String schematargetNamespacePrefix)
      • getTargetNamespace

        public String getTargetNamespace()
      • setTargetNamespace

        public void setTargetNamespace​(String targetNamespace)
      • getTargetNamespacePrefix

        public String getTargetNamespacePrefix()
      • setTargetNamespacePrefix

        public void setTargetNamespacePrefix​(String targetNamespacePrefix)
      • getSchemaElement

        public org.apache.ws.commons.schema.XmlSchemaElement getSchemaElement​(QName elementQName)
      • isEnableAllTransports

        public boolean isEnableAllTransports()
      • setEnableAllTransports

        public void setEnableAllTransports​(boolean enableAllTransports)
        To eneble service to be expose in all the transport
        Parameters:
        enableAllTransports -
      • getExposedTransports

        public List<String> getExposedTransports()
      • setExposedTransports

        public void setExposedTransports​(List transports)
      • addExposedTransport

        public void addExposedTransport​(String transport)
      • removeExposedTransport

        public void removeExposedTransport​(String transport)
      • isExposedTransport

        public boolean isExposedTransport​(String transport)
      • createClientSideAxisService

        public static AxisService createClientSideAxisService​(URL wsdlURL,
                                                              QName wsdlServiceName,
                                                              String portName,
                                                              Options options)
                                                       throws AxisFault
        To create a AxisService for a given WSDL and the created client is most suitable for client side invocation not for server side invocation. Since all the soap action and wsa action is added to operations
        Parameters:
        wsdlURL - location of the WSDL
        wsdlServiceName - name of the service to be invoke , if it is null then the first one will be selected if there are more than one
        portName - name of the port , if there are more than one , if it is null then the first one in the iterator will be selected
        options - Service client options, to set the target EPR
        Returns:
        AxisService , the created service will be return
        Throws:
        AxisFault
      • createService

        public static AxisService createService​(String implClass,
                                                AxisConfiguration axisConfig)
                                         throws AxisFault
        To create an AxisService using given service impl class name first generate schema corresponding to the given java class , next for each methods AxisOperation will be created. If the method is in-out it will uses RPCMessageReceiver else RPCInOnlyMessageReceiver

        Note : Inorder to work this properly RPCMessageReceiver should be available in the class path otherewise operation can not continue

        Parameters:
        implClass - Service implementation class
        axisConfig - Current AxisConfiguration
        Returns:
        return created AxisSrevice the creted service , it can either be null or valid service
        Throws:
        AxisFault
      • createService

        public static AxisService createService​(String implClass,
                                                AxisConfiguration axisConfiguration,
                                                Map messageReceiverClassMap,
                                                String targetNamespace,
                                                String schemaNamespace,
                                                ClassLoader loader)
                                         throws AxisFault
        messageReceiverClassMap will hold the MessageReceivers for given meps. Key will be the mep and value will be the instance of the MessageReceiver class. Ex: Map mrMap = new HashMap(); mrMap.put("http://www.w3.org/ns/wsdl/in-only", RPCInOnlyMessageReceiver.class.newInstance()); mrMap.put("http://www.w3.org/ns/wsdl/in-out", RPCMessageReceiver.class.newInstance());
        Parameters:
        implClass -
        axisConfiguration -
        messageReceiverClassMap -
        targetNamespace -
        schemaNamespace -
        Throws:
        AxisFault
      • createService

        public static AxisService createService​(String implClass,
                                                String serviceName,
                                                AxisConfiguration axisConfiguration,
                                                Map<String,​MessageReceiver> messageReceiverClassMap,
                                                String targetNamespace,
                                                ClassLoader loader,
                                                SchemaGenerator schemaGenerator,
                                                AxisService axisService)
                                         throws AxisFault
        messageReceiverClassMap will hold the MessageReceivers for given meps. Key will be the mep and value will be the instance of the MessageReceiver class. Ex: Map mrMap = new HashMap(); mrMap.put("http://www.w3.org/ns/wsdl/in-only", RPCInOnlyMessageReceiver.class.newInstance()); mrMap.put("http://www.w3.org/ns/wsdl/in-out", RPCMessageReceiver.class.newInstance());
        Parameters:
        implClass -
        axisConfiguration -
        messageReceiverClassMap -
        targetNamespace -
        Throws:
        AxisFault
      • removeOperation

        public void removeOperation​(QName opName)
      • getNamespaceMap

        public Map getNamespaceMap()
        Get the namespace map for this service.
        Returns:
        a Map of prefix (String) to namespace URI (String)
      • getImportedNamespaces

        public List getImportedNamespaces()
        Get the namespaces associated with imported WSDLs
        Returns:
        a List of namespace URIs (String)
      • setImportedNamespaces

        public void setImportedNamespaces​(List importedNamespaces)
        Set the namespaces associated with imported WSDLs
        Parameters:
        importedNamespaces -
      • setNamespaceMap

        public void setNamespaceMap​(org.apache.ws.commons.schema.utils.NamespaceMap namespaceMap)
      • populateSchemaMappings

        public Map populateSchemaMappings()
      • populateSchemaMappings

        public Map populateSchemaMappings​(boolean overrideAbsoluteAddress)
        runs the schema mappings if it has not been run previously it is best that this logic be in the axis service since one can call the axis service to populate the schema mappings
      • isClientSide

        public boolean isClientSide()
      • setClientSide

        public void setClientSide​(boolean clientSide)
      • isElementFormDefault

        public boolean isElementFormDefault()
      • setElementFormDefault

        public void setElementFormDefault​(boolean elementFormDefault)
      • isUseUserWSDL

        public boolean isUseUserWSDL()
        User can set a parameter in services.xml saying he want to show the original wsdl that he put into META-INF once someone ask for ?wsdl so if you want to use your own wsdl then add following parameter into services.xml true
      • isModifyUserWSDLPortAddress

        public boolean isModifyUserWSDLPortAddress()
        By default the port address in user WSDLs is modified, set the following parameter to override this behaviour false
      • setServiceLifeCycle

        public void setServiceLifeCycle​(ServiceLifeCycle serviceLifeCycle)
      • getP2nMap

        public Map getP2nMap()
      • setP2nMap

        public void setP2nMap​(Map p2nMap)
      • setObjectSupplier

        public void setObjectSupplier​(ObjectSupplier objectSupplier)
      • getTypeTable

        public TypeTable getTypeTable()
      • setTypeTable

        public void setTypeTable​(TypeTable typeTable)
      • getData

        public Data[] getData​(DataRetrievalRequest request,
                              MessageContext msgContext)
                       throws AxisFault
        Find a data locator from the available data locators (both configured and default ones) to retrieve Metadata or data specified in the request.
        Parameters:
        request - an DataRetrievalRequest object
        msgContext - message context
        Returns:
        array of Data object for the request.
        Throws:
        AxisFault
      • addDataLocatorClassNames

        public void addDataLocatorClassNames​(String dialect,
                                             String dataLocatorClassName)
        Save data Locator configured at service level for this Axis Service
        Parameters:
        dialect - - an absolute URI represents the Dialect i.e. WSDL, Policy, Schema or "ServiceLevel" for non-dialect service level data locator.
        dataLocatorClassName - - class name of the Data Locator configured to support data retrieval for the specified dialect.
      • setMessageElementQNameToOperationMap

        public void setMessageElementQNameToOperationMap​(Map messageElementQNameToOperationMap)
        Set the map of WSDL message element QNames to AxisOperations for this service. This map is used during SOAP Body-based routing for document/literal bare services to match the first child element of the SOAP Body element to an operation. (Routing for RPC and document/literal wrapped services occurs via the operationsAliasesMap.)

        From section 4.7.6 of the WS-I BP 1.1: the "operation signature" is "the fully qualified name of the child element of SOAP body of the SOAP input message described by an operation in a WSDL binding," and thus this map must be from a QName to an operation.

        Parameters:
        messageElementQNameToOperationMap - The map from WSDL message element QNames to AxisOperations.
      • getOperationByMessageElementQName

        public AxisOperation getOperationByMessageElementQName​(QName messageElementQName)
        Look up an AxisOperation for this service based off of an element QName from a WSDL message element.
        Parameters:
        messageElementQName - The QName to search for.
        Returns:
        The AxisOperation registered to the QName or null if no match was found.
        See Also:
        setMessageElementQNameToOperationMap(Map)
      • addMessageElementQNameToOperationMapping

        public void addMessageElementQNameToOperationMapping​(QName messageElementQName,
                                                             AxisOperation operation)
        Add an entry to the map between element QNames in WSDL messages and AxisOperations for this service.
        Parameters:
        messageElementQName - The QName of the element on the input message that maps to the given operation.
        operation - The AxisOperation to be mapped to.
        See Also:
        setMessageElementQNameToOperationMap(Map)
      • isCustomWsdl

        public boolean isCustomWsdl()
      • setCustomWsdl

        public void setCustomWsdl​(boolean customWsdl)
      • getOperationsNameList

        public List getOperationsNameList()
      • setOperationsNameList

        public void setOperationsNameList​(List operationsNameList)
      • setExcludeInfo

        public void setExcludeInfo​(ExcludeInfo excludeInfo)
      • registerPolicy

        public void registerPolicy​(String key,
                                   org.apache.neethi.Policy policy)
      • lookupPolicy

        public org.apache.neethi.Policy lookupPolicy​(String key)
      • addMessageContextListener

        public void addMessageContextListener​(MessageContextListener scl)
        Add a ServiceContextListener
        Parameters:
        scl -
      • removeMessageContextListener

        public void removeMessageContextListener​(MessageContextListener scl)
        Remove a ServiceContextListener
        Parameters:
        scl -
      • hasMessageContextListener

        public boolean hasMessageContextListener​(Class cls)
        Parameters:
        cls - Class of ServiceContextListener
        Returns:
        true if ServiceContextLister is in the list
      • attachServiceContextEvent

        public void attachServiceContextEvent​(ServiceContext sc,
                                              MessageContext mc)
        Signal an Attach ServiceContext Event
        Parameters:
        sc - ServiceContext
        mc - MessageContext
      • attachEnvelopeEvent

        public void attachEnvelopeEvent​(MessageContext mc)
        Signal an Attach Envelope Event
        Parameters:
        mc - MessageContext
      • createClientSideAxisService

        public static AxisService createClientSideAxisService​(org.apache.woden.wsdl20.Description description,
                                                              QName wsdlServiceName,
                                                              String endPoint,
                                                              Options options)
                                                       throws AxisFault
        returns a axisService given a input Stream of WSDL2.0 document.
        Parameters:
        description - WSDL description
        wsdlServiceName -
        endPoint -
        options -
        Returns:
        Throws:
        AxisFault