login button

calling web service after WSAS starts programmatically

Forums :

I need to call a web service everytime WSAS is restarted programmatically.  Is there a way to do this?  If so, how?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Here is what you need to

Here is what you need to do:

 

Locate the following section in the WSAS server.xml file.

1.

<ServerInitializers>

        <Initializer>org.wso2.wsas.DefaultServerInitializer</Initializer>

</ServerInitializers>

2. Implement ServerInitializer interface as follows:

public class MyServerInitializer implements ServerInitializer {



    public void init(ConfigurationContext configurationContext) throws AxisFault, ServerException {

       //TODO: Call external Web service

    }

}

Implement the init method

3. Create a jar file containing the compiled code in WSAS lib

4. Add a server initializer entry

<ServerInitializers>

        <Initializer>org.wso2.wsas.DefaultServerInitializer</Initializer>

       <Initializer>MyServerInitializer</Initializer>

</ServerInitializers>

5. Restart WSAS

 

 

Regards

Afkham Azeez

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.