File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Using Xfire to transfer a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Using Xfire to transfer a file" Watch "Using Xfire to transfer a file" New topic

Using Xfire to transfer a file

ying lam
Ranch Hand

Joined: May 17, 2004
Posts: 85

I am trying to use xfire to transfer a file.

I have a WebService client which calls a method call 'getLog' to get a file from the WebService server.

My service.xml

On my Web Service server, i have printfs statement on my server on
before and after return the datasource, it works (I see the printfs at
the console).
My Server code:
public DataSource getLog()
System.out.println (" getLog is getting called");

try {
DataSource ds = new FileDataSource ("/" ) ;

System.out.println ("done created!");

return ds;

} catch (Throwable t) {
return null;

My client code:
DataSource source = service.getLog();

I set breakpoint at the client, it fails when it is calling that method.


I get this exception:

Exception in thread "main" org.codehaus.xfire.XFireRuntimeException:
Could not invoke service.. Nested exception is
org.codehaus.xfire.fault.XFireFault: Could not find the attachment
org.codehaus.xfire.fault.XFireFault: Could not find the attachment
at org.codehaus.xfire.aegis.type.mtom.AbstractXOPType.readInclude(
at org.codehaus.xfire.aegis.type.mtom.AbstractXOPType.readObject(
at org.codehaus.xfire.aegis.AegisBindingProvider.readParameter(
at org.codehaus.xfire.service.binding.WrappedBinding.readMessage(
at org.codehaus.xfire.soap.handler.SoapBodyHandler.invoke(
at org.codehaus.xfire.handler.HandlerPipeline.invoke(
at org.codehaus.xfire.client.Client.onReceive(
at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(
at org.codehaus.xfire.transport.http.HttpChannel.send(
at org.codehaus.xfire.handler.OutMessageSender.invoke(
at org.codehaus.xfire.handler.HandlerPipeline.invoke(
at org.codehaus.xfire.client.Invocation.invoke(
at org.codehaus.xfire.client.Client.invoke(
at org.codehaus.xfire.client.XFireProxy.handleRequest(
at org.codehaus.xfire.client.XFireProxy.invoke(
at $Proxy0.getLog(Unknown Source)
at org.codehaus.xfire.demo.BookClient.main(
I agree. Here's the link:
subject: Using Xfire to transfer a file
jQuery in Action, 3rd edition