Can you use tcpmon and check what message is returned to client ?
On 5/9/06, Steve Barham <[EMAIL PROTECTED]> wrote:
Hi there,
I'm trying to test my secured web-service. I've been following the example
provided with Xfire, but have run into a problem which I'm unsure how to
progress with. I get this stack trace when I try to invoke my service:
Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Could
not invoke service.. Nested exception is
org.codehaus.xfire.fault.XFireFault: Fault:
javax.xml.stream.XMLStreamException
org.codehaus.xfire.fault.XFireFault: Fault:
javax.xml.stream.XMLStreamException
at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89)
at org.codehaus.xfire.client.Client.onReceive(Client.java:461)
at
org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:174)
at
org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:66)
at
org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
at
org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:98)
at org.codehaus.xfire.client.Client.invoke(Client.java:359)
at
org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy0.sendChannelMessage(Unknown Source)
at TestService.execute(TestService.java:34)
at TestService.main(TestService.java:21)
Caused by: javax.xml.stream.XMLStreamException
at com.bea.xml.stream.MXParser.parseProlog(MXParser.java:1945)
at com.bea.xml.stream.MXParser.nextImpl(MXParser.java:1839)
at com.bea.xml.stream.MXParser.next(MXParser.java:1261)
at
org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(ReadHeadersHandler.java:44)
at
org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:98)
at org.codehaus.xfire.client.Client.onReceive(Client.java:448)
... 10 more
The code that I use is largely based on the WSS4J example:
public void execute() throws MalformedURLException
{
DefaultXFire xfire =
(DefaultXFire)XFireFactory.newInstance().getXFire();
xfire.addOutHandler(new DOMOutHandler());
Properties properties = new Properties();
configureProperties(properties);
xfire.addOutHandler(new WSS4JOutHandler(properties));
Service serviceModel = new
ObjectServiceFactory().create(Messaging.class, "MessagingService",
SERVICE_NAMESPACE, null);
Messaging service = (Messaging)new
XFireProxyFactory().create(serviceModel, SERVICE_URL +
"Messaging");
service.sendChannelMessage("botdev", "bots", false, "Test message
to channel without alert");
}
private void configureProperties(Properties properties)
{
properties.setProperty(WSHandlerConstants.ACTION,
WSHandlerConstants.SIGNATURE + " " + WSHandlerConstants.ENCRYPT);
properties.setProperty(WSHandlerConstants.USER, "ws-client-a");
properties.setProperty(WSHandlerConstants.ENC_PROP_FILE,
"security.properties");
properties.setProperty(WSHandlerConstants.SIG_PROP_FILE,
"security.properties");
properties.setProperty(WSHandlerConstants.ENCRYPTION_USER,
"ws-server");
properties.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS,
"TestPasswordCallback");
}
Does anyone have any suggestions on what could be causing this error?
Thanks,
Steve
--
Steve Barham tel: +44 (0)7973 199 471
Systems Engineer
Formicary - delivering quality financial technology solutions
http://www.formicary.net/
--
Your plan looks like it was written by a drunken lemur as a practical
joke on other drunken lemurs.