AnsweredAssumed Answered

Running WebServiceSamples outside Eclipse IDE

Question asked by drbaz on Dec 2, 2005
Latest reply on Dec 2, 2005 by drbaz
II have "copied" the delivered WebServiceSample java code to my own classes - CMCLExample1, CMCLExample2 etc etc
The code for CMCLExample1 is identical to WebServiceSample1 except for the  passWordCallbackClass
which is defined as
<parameter name='passwordCallbackClass' value='com.comanaco.alfresco.CMCLExample1'/>"
The full definiton of the WS_SECURITY_INFO string is
public static final String WS_SECURITY_INFO = 

         "<deployment xmlns='http://xml.apache.org/axis/wsdd/' xmlns:java='http://xml.apache.org/axis/wsdd/providers/java'>" +

         "   <transport name='http' pivot='java:org.apache.axis.transport.http.HTTPSender'/>" +

         "   <globalConfiguration >" +

         "      <requestFlow >" +

         "       <handler type='java:org.apache.ws.axis.security.WSDoAllSender' >" +

         "               <parameter name='action' value='UsernameToken'/>" +

         "               <parameter name='user' value='ticket'/>" +

         "               <parameter name='passwordCallbackClass' value='com.comanaco.alfresco.CMCLExample1'/>" +

         "               <parameter name='passwordType' value='PasswordText'/>" +

         "           </handler>" +

         "       </requestFlow >" +

         "   </globalConfiguration>" +

         "</deployment>";

When I run CMCLExample2 from within Eclipse IDE …it works ok
When I run WebServiceSample2 from Eclipse and Op sys, it works ok.

When I run CMCLExample2 from the op sys command prompt, I get the following error
Exception in thread "main" AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString: WSDoAllSender: password callback class provided null or empty password
faultActor:
faultNode:
faultDetail:
        {http://xml.apache.org/axis/}stackTrace:WSDoAllSender: password callback class provided null or empty password
        at org.apache.ws.axis.security.WSDoAllSender.getPassword(WSDoAllSender.java:861)
        at org.apache.ws.axis.security.WSDoAllSender.performUTAction(WSDoAllSender.java:465)
        at org.apache.ws.axis.security.WSDoAllSender.invoke(WSDoAllSender.java:314)
        at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:127)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
        at org.apache.axis.client.Call.invoke(Call.java:2748)
        at org.apache.axis.client.Call.invoke(Call.java:2424)
        at org.apache.axis.client.Call.invoke(Call.java:2347)
        at org.apache.axis.client.Call.invoke(Call.java:1804)
        at org.alfresco.example.webservice.repository.RepositoryServiceSoapBindingStub.query(RepositoryServiceSoapBindingStub.java:712)
        at com.comanaco.alfresco.CMCLExample2.executeSearch(CMCLExample2.java:91)
        at com.comanaco.alfresco.CMCLExample2.main(CMCLExample2.java:62)

        {http://xml.apache.org/axis/}hostname:linuxserver

WSDoAllSender: password callback class provided null or empty password
        at org.apache.ws.axis.security.WSDoAllSender.getPassword(WSDoAllSender.java:861)
        at org.apache.ws.axis.security.WSDoAllSender.performUTAction(WSDoAllSender.java:465)
        at org.apache.ws.axis.security.WSDoAllSender.invoke(WSDoAllSender.java:314)
        at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:127)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
        at org.apache.axis.client.Call.invoke(Call.java:2748)
        at org.apache.axis.client.Call.invoke(Call.java:2424)
        at org.apache.axis.client.Call.invoke(Call.java:2347)
        at org.apache.axis.client.Call.invoke(Call.java:1804)
        at org.alfresco.example.webservice.repository.RepositoryServiceSoapBindingStub.query(RepositoryServiceSoapBindingStub.java:712)
        at com.comanaco.alfresco.CMCLExample2.executeSearch(CMCLExample2.java:91)
        at com.comanaco.alfresco.CMCLExample2.main(CMCLExample2.java:62)


Any suggestions ? :D  :shock:

Outcomes