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

    Call webservide at esb package

    german.castro

      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@?

        • 1. Re: Call webservide at esb package
          burrsutter

          When you say esb package do you mean the .esb archive?

          This is possible and I believe Kurt has the technique in his head. Perhaps we can entice him to comment on this item.

          Burr

          • 2. Re: Call webservide at esb package
            kconner

             

            "gecastro" wrote:
            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.


            If these files are packaged in your .esb archive then you can just use the normal Class/ClassLoader getResource method to return a URL.