3 Replies Latest reply on Oct 3, 2012 3:53 AM by Viral Gohel

    referencing jboss-wsse-client.xml in WAR

    Nicklas Karlsson Master

      Hi,

      Noob question: I have a WAR that serves both as a provider and consumer of a secure web service. In the client section I try to do a

      ((StubExt)port).setSecurityConfig(new File("WEB-INF/jboss-wsse-client.xml").toURL().toExternalForm());


      but end up with a FileNotFound for

      <JBOSS_HOME>\bin\META-INF\jboss-wsse-client.xml
      


      What is the correct way of referencing an internal file? I think I have had the same scenario in EAR archives and there the reference was OK.

      Thanks in advance,

        • 1. Re: referencing jboss-wsse-client.xml in WAR
          Alessio Soldano Master

          Given that JBossWS should load by default the META-INF/jboss-wsse-client.xml in your jar file if you don't explicitly provide that url, generally speaking you can access resources in a jar using the getResource() method of Class.

          • 2. Re: referencing jboss-wsse-client.xml in WAR
            Elena Me Newbie

            Hi,

            I have a WAR that contains the server (provider of a secure web service) and an EAR that contains the client (as a jar) and a war that implements a servlet to test the client.

             

            EAR = client.jar + servlet.war

            WAR = server.war

             

            In the client I do

             

             

            ((StubExt)port).setSecurityConfig(new File("META-INF/jboss-wsse-client.xml").toURL().toExternalForm());
            

             

             

            but I have a FileNotFound Error

             

             

            <JBOSS_HOME>\bin\META-INF\jboss-wsse-client.xml
            


            I also try with:

             

             

            URL fileURL = this.getClass().getResource("META-INF/jboss-wsse-client.xml");

            StubExt stub = (StubExt) port1;

            stub.setSecurityConfig(fileURL.toExternalForm());



            But in this way error is: fileURL is null

             

            It's like if my JBoss don't load by default the META-INF/jboss-wsse-client.xml of my jar file, but try to load in <JBOSS_HOME>\bin\META-INF\jboss-wsse-client.xml

            I can't create a dir META-INF in <JBOSS_HOME>\bin with this file (in this case i haven't error! XD)

             

             

            What I wrong? I must set something? Please, can you help me?

             

            Thanks in advance

            • 3. Re: referencing jboss-wsse-client.xml in WAR
              Viral Gohel Newbie

              Hi,

               

              Can you please try including the file in the root classpath of your application ?