You maybe did not use the correct target end point:
http://localhost/stellent/idcplg/. Did you get  your web service server
running? If you deployed Axis2 into Tomcat, the target end point should
be like http://localhost:8080/axis2/services/yourwebservice.

 

Hailong

 

________________________________

From: tyson magney [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 31, 2007 12:06 PM
To: axis-user@ws.apache.org
Subject: Authentication Issue

 

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(DescriptionBuilde
r.java:86)
    at
org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigB
uilder.java :58)
    at
org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(D
eploymentEngine.java:690)
    at
org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
FileSystemConfigurator.java :109)
    at
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
Context(ConfigurationContextFactory.java:61)
    at
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
ContextFromFileSystem (ConfigurationContextFactory.java:180)
    at
org.apache.axis2.client.ServiceClient.initializeTransports(ServiceClient
.java:189)
    at
org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClie
nt.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/
<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

Reply via email to