Hello, I am in the process of evaluating Soap toolkits. Axis2 looks promising but I am having an issue setting up a test client. I have successfully run the WSDL2Java Eclipse plugin to create my stub class. I wrote some client code to connect to my web services but it throws an exception. Here is the code.
DocInfoStub stub = null; stub = new DocInfoStub("http://localhost/stellent/idcplg/"); <-- Fatal error here. DocInfoStub.DocInfoByName request = new DocInfoStub.DocInfoByName(); request.setDDocName("000107"); DocInfoStub.DocInfoByNameResponse response = stub.DocInfoByName(request); Here is the fatal exception when I try to instanciate the DocInfoStub class. java.lang.ExceptionInInitializerError at org.apache.axis2.deployment.DescriptionBuilder.buildOM( DescriptionBuilder.java:86) at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig( AxisConfigBuilder.java:58) at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration( DeploymentEngine.java:690) at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration( FileSystemConfigurator.java:109) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext (ConfigurationContextFactory.java:61) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem (ConfigurationContextFactory.java:180) at org.apache.axis2.client.ServiceClient.initializeTransports( ServiceClient.java:189) at org.apache.axis2.client.ServiceClient.configureServiceClient( ServiceClient.java:118) at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:114) at com.stellent.www.docinfo.DocInfoStub.<init>(DocInfoStub.java:82) at com.stellent.www.docinfo.DocInfoStub.<init>(DocInfoStub.java:106) at com.imagesourceinc.Axis2Test.main(Axis2Test.java:31) Caused by: java.lang.IllegalStateException: No valid ObjectCreator found. at org.apache.axiom.om.util.StAXUtils$Pool.<init>(StAXUtils.java:41) at org.apache.axiom.om.util.StAXUtils.<clinit>(StAXUtils.java:62) ... 12 more Exception in thread "main" I believe the issue is that I need to authenticate the webservice. I tried using an endpoint URL like "http://sysadmin:[EMAIL PROTECTED]/stellent/idcplg/" but it didnt help. I added an Authenticator and Options object based on the Http Authentication example on the Axis2 site but it did not work either. However the documentation does not explain how to add the options to a client stub class. The same exception results either way. In Axis 1.4, when I did not authenticate properly I received a 401 Http response. DocInfoStub stub = null; //new code Options options = new Options(); HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator(); auth.setUsername("sysadmin"); auth.setPassword("idc"); options.setProperty(HttpTransportProperties.Authenticator.BASIC, auth); //end new code stub = new DocInfoStub("http://localhost/stellent/idcplg/"); <-- Fatal error here. DocInfoStub.DocInfoByName request = new DocInfoStub.DocInfoByName(); request.setDDocName("000107"); DocInfoStub.DocInfoByNameResponse response = stub.DocInfoByName(request); Any help is appreciated. Thanks. - Tyson