package com.mycompany.myproject;

import javax.xml.ws.*;
import javax.xml.ws.soap.*;
import javax.ejb.Remote;
import javax.ejb.Stateful;
import javax.annotation.PostConstruct;

@Stateful
@Remote({EjbClientIF.class})
public class EjbClient implements EjbClientIF {

    @WebServiceRef(name="service/wswsreflookupservice")
    EchoService service = null;

    Echo port = null;

    @WebServiceRef(lookup="java:comp/env/service/wswsreflookupservice")
    EchoService service2 = null;

    Echo port2 = null;

    private void getPort() throws Exception {
        port = (Echo) service.getPort(Echo.class);
        port2 = (Echo) service2.getPort(Echo.class);
    }

    @PostConstruct
    public void postConstruct() {
        try {
            getPort();
        } catch (Exception e) {}
    }

    public boolean testwsreflookup() {
        // do something with port & port2 JAXWS proxies
    }

}
