2 Replies Latest reply on Apr 23, 2007 5:18 AM by Kevin Conner

    Call webservide at esb package

    German Castro Newbie

      Looking at jbossws examples i see two ways to get a reference to a webservice

      1)

      InitialContext iniCtx = new InitialContext();
      Hashtable env = iniCtx.getEnvironment();
      env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
      env.put("j2ee.clientName", "jbossws-client");
      Service service = (Service)iniCtx.lookup("java:comp/env/pkg/ws");
      wsSEI port = (wsSEI)service.getPort(wsSEI.class);

      This way needs a file application-client.xml and jboss-client.xml to register the jndi "pkg/ws". But seems to be that esb packages don't support this files.


      2)
      ServiceFactoryImpl factory = new ServiceFactoryImpl();
      URL wsdlURL = new URL("file:c:/file.wsdl");
      URL mappingURL = new URL("file:c://jaxrpc-mapping.xml");
      QName qname = new QName("urn:ns/wsdl", "ws");
      Service service = factory.createService(wsdlURL, qname, mappingURL);
      wsSEI port = (wsSEI)service.getPort(wsSEI.class);

      This way works fine when i use an absolute hardcoded URL for files, but i need use a variable like @CONFIG_ABSOLUTE_PATH@ for use files packaged into esb package.

      Anybody knows how i can register the jndi or how get a variable seems to @CONFIG_ABSOLUTE_PATH@?