I still have a problem with this type of invocation. Now i get the
following exception:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}MustUnderstand
faultSubcode:
faultString: Did not understand "MustUnderstand" header(s):
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:
at
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:96)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
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
al.JCT.service.JCTSoapBindingStub.getJobStatus(JCTSoapBindingStub.java:316)
at JobStatus.main(JobStatus.java:35)
{http://xml.apache.org/axis/}hostname:erle
Did not understand "MustUnderstand" header(s):
at
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:96)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
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
al.JCT.service.JCTSoapBindingStub.getJobStatus(JCTSoapBindingStub.java:316)
at JobStatus.main(JobStatus.java:35)
This is my WSDD file. When i use this to configure Axis everything works
fine.
Thanks for any help!
Michael
<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="passwordCallbackClass" value="PWCallback"/>
</handler>
</requestFlow >
</globalConfiguration >
</deployment>
Ok found a solution for this one....needed to pass a String for the
PWCallback class, not the class itself.
Hi,
im trying to contact an axis ws that uses wss4j without using a wsdd
config file. Since i switched from the WSDD to the following code, i
get the execption mentioned below. any ideas?
AxisFault
faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.ClassCastException: PWCallback
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.lang.ClassCastException:
PWCallback
at
org.apache.ws.axis.security.WSDoAllSender.getPassword(WSDoAllSender.java:855)
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.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:165)
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
JCT.service.al.JCTSessionSoapBindingStub.getJobStatus(JCTSessionSoapBindingStub.java:316)
at JobStatus.main(JobStatus.java:33)
{http://xml.apache.org/axis/}hostname:erle
java.lang.ClassCastException: PWCallback
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:216)
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
JCT.service.al.JCTSessionSoapBindingStub.getJobStatus(JCTSessionSoapBindingStub.java:316)
at JobStatus.main(JobStatus.java:33)
Caused by: java.lang.ClassCastException: PWCallback
at
org.apache.ws.axis.security.WSDoAllSender.getPassword(WSDoAllSender.java:855)
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.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:165)
... 7 more
public class JobStatus {
public static void main(String[] args) {
try {
JCTSessionServiceLocator service = new
JCTSessionServiceLocator();
EngineConfiguration
clientConfig=createClientConfig();
service.setEngineConfiguration(clientConfig);
service.setEngine(new AxisClient(clientConfig));
JCTSession jct = service.getJCTSession();
Job[] jobs = jct.getJobStatus("rudi", null, null,
null);
}
catch(Exception e) {
e.printStackTrace();
}
}
private static EngineConfiguration createClientConfig() {
try {
SimpleProvider clientConfig=new SimpleProvider();
Handler securityHandler= (Handler)new WSDoAllSender();
securityHandler.setOption(WSHandlerConstants.ACTION,
"UsernameToken");
//securityHandler.setOption(WSHandlerConstants.SIG_PROP_FILE,this.WSS_SIG_PROPERTIES);
securityHandler.setOption(WSHandlerConstants.USER, "rudi");
securityHandler.setOption(WSHandlerConstants.PW_CALLBACK_CLASS, new
PWCallback());
SimpleChain reqHandler=new SimpleChain();
SimpleChain respHandler=new SimpleChain();
// add the handler to the request
reqHandler.addHandler(securityHandler);
// add the handler to the response
respHandler.addHandler(securityHandler);
Handler pivot=(Handler)new HTTPSender();
Handler transport=new
SimpleTargetedChain(reqHandler, pivot, respHandler);
clientConfig.deployTransport(HTTPTransport.DEFAULT_TRANSPORT_NAME,transport);
return clientConfig;
}
catch(Exception e) {
e.printStackTrace();
return null;
}
}
}
public class PWCallback implements CallbackHandler {
public void handle(Callback[] callbacks) throws IOException,
UnsupportedCallbackException {
for (int i = 0; i < callbacks.length; i++) {
if (callbacks[i] instanceof WSPasswordCallback) {
WSPasswordCallback pc = (WSPasswordCallback)
callbacks[i];
// set the password given a username
if("rudi".equals(pc.getIdentifer())) {
pc.setPassword("dsgxdgsfsdgfsdgs");
}
}
else {
throw new UnsupportedCallbackException(callbacks[i],
"Unrecognized Callback");
}
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]