calling web service after WSAS starts programmatically
I need to call a web service everytime WSAS is restarted programmatically. Is there a way to do this? If so, how?
- Login or register to post comments
- Printer friendly version
- 151 reads
I need to call a web service everytime WSAS is restarted programmatically. Is there a way to do this? If so, how?
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