2 Replies Latest reply on Jan 22, 2006 3:51 PM by Thomas Diesler

    Does it allowed to call a web service from EJB3 (not through

    amit Newbie

       

      1.) I prefer to use this method instead of JNDI because as far I understand EJB3 doesn't support calling a web-service nor exposing a web-service, am I right?
      2.) i.e - may I call within EJB3 stateless session bean a web service as the following code (not through JNDI)?
      3.) the following code works, but I still don't understand in which cases Do I need to send the wsdd url?
      4.) Is There a way to retrieve the jaxrpc-mapping.xml from the remote web service instead of keep it local in the client side?


      Thanks alot.

      File file = new File("jaxrpc-mapping.xml");
      URL mappingLocation = file.toURL();
      URL url = new URL("http://localhost:8070/GWSimManager/DeviceManagerEndpoint?wsdl");
      QName serviceName = new QName("http://com.imagine.platformSim", "DeviceManagerService");
      
      ServiceFactoryImpl factory = (ServiceFactoryImpl) ServiceFactory.newInstance();
      Service service = (Service)factory.createService(url, mappingLocation,null,serviceName,null);
      //this create a dynamic proxy which implement the SEI which return the stub.
      DeviceManagerEndpoint devMgr = (DeviceManagerEndpoint) service.getPort(DeviceManagerEndpoint.class);
      PlatformPort port = devMgr.getPortDetails();
      System.out.println(port.getName());
      System.out.println("get Port details!!!");