Pergunta

I'm new to Axis2 webservice.

After reading tutorial, I created an example that use transport session, but I cannot set timeout for that session, this is how I have implemented:

1 Hello.java

package home;

import org.apache.axis2.context.MessageContext;
import org.apache.axis2.context.ServiceContext;

public class Hello {

    public String hello(String name) {                      
        String sessionKey = "sessionKey";   
        ServiceContext sc = MessageContext.getCurrentMessageContext().getServiceContext();
        Object obj = sc.getProperty(sessionKey );
        String result = (obj == null) ? name: obj.toString() + name;
        sc.setProperty(sessionKey , name);

        return result;
    }
}

2 services.xml

< service name="Hello" scope="transportsession">

3 axis2.xml

< parameter name="ConfigContextTimeoutInterval">30000

Thanks in advance.

Foi útil?

Solução

In the case of Transport session , the life time of that session is controlled by the transport,not by Axis2.In this situations Axis 2 uses transport related session management techniques to manage sessions. So you have to configure the transport session timeout from the application server which you are using.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top