package com.webservice.sessionBean;

import com.webservice.response.ResponseBean;
import com.webservice.response.StringArray;
import com.webservice.response.ResponseClass;

import javax.ejb.SessionContext;
import javax.ejb.EJBException;
import javax.ejb.CreateException;
import javax.ejb.SessionBean;

/**
 * Created by IntelliJ IDEA.
 * User: John Green
 * Date: Apr 27, 2005
 * Time: 4:32:30 PM
 * To change this template use File | Settings | File Templates.
 */
public class WSTestSessionBean implements SessionBean {
    public WSTestSessionBean() {
    }

    public void setSessionContext(SessionContext sessionContext) throws EJBException {
        //To change body of implemented  methods use File | Settings | File Templates.
    }

    public void ejbCreate() throws CreateException {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    public void ejbPassivate() throws EJBException {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    public void ejbActivate() throws EJBException {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    public void ejbRemove() throws EJBException {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    public ResponseBean createResponse() throws Exception {

        ResponseBean response = new ResponseBean();
        String[] stringArray = {"string 1", "string 2", "string3"};
        response.setStrArray(stringArray);
        StringArray strngArray = new StringArray();
        String[] stringArray2 = {"string 4", "string 5", "string6"};
        strngArray.setStringArray(stringArray2);
        response.setStrArray2(strngArray);
        ResponseClass rc = new ResponseClass();
        rc.setName("Test 1");
        rc.setDescription("Description test 1");
        ResponseClass rc2 = new ResponseClass();
        rc2.setName("Test 2");
        rc2.setDescription("Description test 2");
        ResponseClass[] rcArray = {rc,rc2};
        response.setComplexResponses(rcArray);
        return response;
    }
}
