Re: Loading Axis2 repository from classpath instead of file system
Thanks Andreas, that worked like a charm. Makes sense... no way to get a file listing from a URI. Regards, Stephanos Piperoglou Price Control GTO - BAC IT +44 20 754 59007 This mail is transmitted to you on behalf of the Great East London Software Company Diese Post wird Ihnen im Namen der Great East London Software Company übermittelt Andreas Veithen 28/01/2010 16:08 Please respond to axis-user@ws.apache.org To axis-user@ws.apache.org cc Subject Re: Loading Axis2 repository from classpath instead of file system Yes, this is possible, but you need to add services.list and modules.list files so that Axis2 is able to locate your services and modules. By searching for these two names on the internet and in the mailing list archives, you should be able to find some examples. If not, let us know and we will try to find a sample. Andreas On Thu, Jan 28, 2010 at 16:32, Stephanos Piperoglou < stephanos.piperog...@db.com> wrote: Hi everyone, Short version: Is there a way to load the Axis2 repository using the class loader? Long version: I have got my client running, but I can only manage to initialise the repository from the file system using ConfigurationContextFactory.createConfigurationContextFromFileSystem. However, I would like to package up the repository in my JAR file and load it using the class loader to increase portability. This doesn't seem to work: URL clientRepo = getClass().getResource("/axis2repo"); ConfigurationContextFactory.createConfigurationContextFromURIs(null, clientRepo); ... even though clientRepo.toExternalForm() seems to resolve to the correct place and I can use .getResourceAsStream() to read the files in the repository. Regards, Stephanos Piperoglou Price Control GTO - BAC IT +44 20 754 59007 This mail is transmitted to you on behalf of the Great East London Software Company Diese Post wird Ihnen im Namen der Great East London Software Company übermittelt Stephanos Piperoglou 28/01/2010 14:20 Please respond to axis-user@ws.apache.org To axis-user@ws.apache.org cc Subject Re: Unable to engage module : rampart [RESOLVED] Apologies, it seems the repository wasn't being picked up by the classloader. Regards, Stephanos Piperoglou Price Control GTO - BAC IT +44 20 754 59007 This mail is transmitted to you on behalf of the Great East London Software Company Diese Post wird Ihnen im Namen der Great East London Software Company übermittelt Stephanos Piperoglou 28/01/2010 13:51 Please respond to axis-user@ws.apache.org To axis-user@ws.apache.org cc Subject Unable to engage module : rampart Hi, I have a web service client that ran perfectly under Axis2 (stub generated using ADB bindings) until the provider (not under my control) added WS-Security and now requires username/password auth. I have tried with little success to integrate Rampart into our set-up. What I did, piecing things together from various how-tos: 1. Added all the rampart jars to the classpath 2. Created a client Axis2 repository (I didn't have one of those before) containing conf/, services/ and modules/ 3. Put the two .mar files in /modules 4. Created an axis2.xml config file in conf/ (attached) 5. Added the following around my stub creation code: final ConfigurationContext ctx = ConfigurationContextFactory. createConfigurationContextFromURIs(null, clientRepo); final OpenPvsServiceStub openPvs = new OpenPvsServiceStub(ctx, serviceAddress); final ServiceClient sc = openPvs._getServiceClient(); sc.engageModule("rampart"); final Options options = new Options(); options.setUserName("stephanos.piperog...@db.com"); options.setPassword("x"); sc.setOverrideOptions(options); This causes: org.apache.axis2.AxisFault: Unable to engage module : rampart Any ideas would be greatly appreciated. Regards, Stephanos Piperoglou Price Control GTO - BAC IT +44 20 754 59007 This mail is transmitted to you on behalf of the Great East London Software Company Diese Post wird Ihnen im Namen der Great East London Software Company übermittelt --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.[attachment "axis2.xml" deleted by Stephanos Piperoglou/ext/dbcom] --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. A
Re: Loading Axis2 repository from classpath instead of file system
Yes, this is possible, but you need to add services.list and modules.list files so that Axis2 is able to locate your services and modules. By searching for these two names on the internet and in the mailing list archives, you should be able to find some examples. If not, let us know and we will try to find a sample. Andreas On Thu, Jan 28, 2010 at 16:32, Stephanos Piperoglou < stephanos.piperog...@db.com> wrote: > > Hi everyone, > > Short version: Is there a way to load the Axis2 repository using the class > loader? > > Long version: I have got my client running, but I can only manage to > initialise the repository from the file system using > ConfigurationContextFactory.createConfigurationContextFromFileSystem. > > However, I would like to package up the repository in my JAR file and load > it using the class loader to increase portability. This doesn't seem to > work: > > URL clientRepo = getClass().getResource("/axis2repo"); > ConfigurationContextFactory.createConfigurationContextFromURIs(null, > clientRepo); > > ... even though clientRepo.toExternalForm() seems to resolve to the correct > place and I can use .getResourceAsStream() to read the files in the > repository. > > Regards, > Stephanos Piperoglou > Price Control > GTO - BAC IT > +44 20 754 59007 > > This mail is transmitted to you on behalf of the Great East London Software > Company > Diese Post wird Ihnen im Namen der Great East London Software Company > übermittelt > > > > *Stephanos Piperoglou > > >* > > 28/01/2010 14:20 > Please respond to > axis-user@ws.apache.org > > To > axis-user@ws.apache.org > cc > Subject > Re: Unable to engage module : rampart [RESOLVED] > > > > > > Apologies, it seems the repository wasn't being picked up by the > classloader. > > Regards, > Stephanos Piperoglou > Price Control > GTO - BAC IT > +44 20 754 59007 > > This mail is transmitted to you on behalf of the Great East London Software > Company > Diese Post wird Ihnen im Namen der Great East London Software Company > übermittelt > > > *Stephanos Piperoglou > > >* > > 28/01/2010 13:51 > Please respond to > axis-user@ws.apache.org > > To > axis-user@ws.apache.org > cc > Subject > Unable to engage module : rampart > > > > > > > > Hi, > > I have a web service client that ran perfectly under Axis2 (stub generated > using ADB bindings) until the provider (not under my control) added > WS-Security and now requires username/password auth. I have tried with > little success to integrate Rampart into our set-up. > > What I did, piecing things together from various how-tos: > > 1. Added all the rampart jars to the classpath > 2. Created a client Axis2 repository (I didn't have one of those before) > containing conf/, services/ and modules/ > 3. Put the two .mar files in /modules > 4. Created an axis2.xml config file in conf/ (attached) > 5. Added the following around my stub creation code: > > *final* ConfigurationContext ctx = ConfigurationContextFactory.* > createConfigurationContextFromURIs*(*null*, clientRepo); > *final* OpenPvsServiceStub openPvs = *new*OpenPvsServiceStub(ctx, > serviceAddress); > *final* ServiceClient sc = openPvs._getServiceClient(); > sc.engageModule("rampart"); > *final* Options options = *new* Options(); > options.setUserName("stephanos.piperog...@db.com"); > options.setPassword("x"); > sc.setOverrideOptions(options); > > This causes: > > org.apache.axis2.AxisFault: Unable to engage module : rampart > > Any ideas would be greatly appreciated. > > > > Regards, > Stephanos Piperoglou > Price Control > GTO - BAC IT > +44 20 754 59007 > > This mail is transmitted to you on behalf of the Great East London Software > Company > Diese Post wird Ihnen im Namen der Great East London Software Company > übermittelt > > > --- > > This e-mail may contain confidential and/or privileged information. If you > are not the intended recipient (or have received this e-mail in error) > please notify the sender immediately and delete this e-mail. Any > unauthorized copying, disclosure or distribution of the material in this > e-mail is strictly forbidden. > > Please refer to http://www.db.com/en/content/eu_disclosures.htm for > additional EU corporate and regulatory disclosures.[attachment "axis2.xml" > deleted by Stephanos Piperoglou/ext/dbcom] > > > --- > > This e-mail may contain confidential and/or privileged information. If you > are not the intended recipient (or have received this e-mail in error) > please notify the sender immediately and delete this e-mail. Any > unauthorized copying, disclosure or distribution of the material in this > e-mail is strictly forbidden. > > Please refer to http://www.db.com/en/content/eu_disclosures.htm for > additional EU corporate and regulatory disclosures. > > > --- > > This e-mail may contain confidential and/or privileged information. If you > are not the intended recipient (or have received this e-mail in error)
Loading Axis2 repository from classpath instead of file system
Hi everyone, Short version: Is there a way to load the Axis2 repository using the class loader? Long version: I have got my client running, but I can only manage to initialise the repository from the file system using ConfigurationContextFactory.createConfigurationContextFromFileSystem. However, I would like to package up the repository in my JAR file and load it using the class loader to increase portability. This doesn't seem to work: URL clientRepo = getClass().getResource("/axis2repo"); ConfigurationContextFactory.createConfigurationContextFromURIs(null, clientRepo); ... even though clientRepo.toExternalForm() seems to resolve to the correct place and I can use .getResourceAsStream() to read the files in the repository. Regards, Stephanos Piperoglou Price Control GTO - BAC IT +44 20 754 59007 This mail is transmitted to you on behalf of the Great East London Software Company Diese Post wird Ihnen im Namen der Great East London Software Company übermittelt Stephanos Piperoglou 28/01/2010 14:20 Please respond to axis-user@ws.apache.org To axis-user@ws.apache.org cc Subject Re: Unable to engage module : rampart [RESOLVED] Apologies, it seems the repository wasn't being picked up by the classloader. Regards, Stephanos Piperoglou Price Control GTO - BAC IT +44 20 754 59007 This mail is transmitted to you on behalf of the Great East London Software Company Diese Post wird Ihnen im Namen der Great East London Software Company übermittelt Stephanos Piperoglou 28/01/2010 13:51 Please respond to axis-user@ws.apache.org To axis-user@ws.apache.org cc Subject Unable to engage module : rampart Hi, I have a web service client that ran perfectly under Axis2 (stub generated using ADB bindings) until the provider (not under my control) added WS-Security and now requires username/password auth. I have tried with little success to integrate Rampart into our set-up. What I did, piecing things together from various how-tos: 1. Added all the rampart jars to the classpath 2. Created a client Axis2 repository (I didn't have one of those before) containing conf/, services/ and modules/ 3. Put the two .mar files in /modules 4. Created an axis2.xml config file in conf/ (attached) 5. Added the following around my stub creation code: final ConfigurationContext ctx = ConfigurationContextFactory. createConfigurationContextFromURIs(null, clientRepo); final OpenPvsServiceStub openPvs = new OpenPvsServiceStub(ctx, serviceAddress); final ServiceClient sc = openPvs._getServiceClient(); sc.engageModule("rampart"); final Options options = new Options(); options.setUserName("stephanos.piperog...@db.com"); options.setPassword("x"); sc.setOverrideOptions(options); This causes: org.apache.axis2.AxisFault: Unable to engage module : rampart Any ideas would be greatly appreciated. Regards, Stephanos Piperoglou Price Control GTO - BAC IT +44 20 754 59007 This mail is transmitted to you on behalf of the Great East London Software Company Diese Post wird Ihnen im Namen der Great East London Software Company übermittelt --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.[attachment "axis2.xml" deleted by Stephanos Piperoglou/ext/dbcom] --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures. --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.