Ok, I turned on log4j logger for org.codehaus.xfire... Here is what I see, when my program invokes getDocument(string) method.
[19 16:44:54.109] DEBUG [DocumentDownloader] - after serviceModel obtained [19 16:44:54.140] DEBUG [DocumentDownloader] - Setup properties [19 16:44:54.140] DEBUG [DocumentDownloader] - Properties set [19 16:44:54.140] DEBUG [XFireProxy] - Method [getDocument] [c:/temp/log/OFS.log] [19 16:44:54.156] DEBUG [HttpTransport] - Creating new channel for uri: urn:xfire:transport:http:11770154941560-1044280332 [19 16:44:54.171] DEBUG [HandlerPipeline] - adding handler [EMAIL PROTECTED] to phase send [19 16:44:54.171] DEBUG [HandlerPipeline] - adding handler [EMAIL PROTECTED] to phase transport [19 16:44:54.171] DEBUG [HandlerPipeline] - adding handler [EMAIL PROTECTED] to phase post-invoke [19 16:44:54.171] DEBUG [HandlerPipeline] - Invoking phase post-invoke [19 16:44:54.171] DEBUG [HandlerPipeline] - Invoking handler org.codehaus.xfire.soap.handler.SoapSerializerHandler in phase post-invoke [19 16:44:54.171] DEBUG [HandlerPipeline] - Invoking phase policy [19 16:44:54.171] DEBUG [HandlerPipeline] - Invoking phase user [19 16:44:54.171] DEBUG [HandlerPipeline] - Invoking phase transport [19 16:44:54.171] DEBUG [HandlerPipeline] - Invoking handler org.codehaus.xfire.soap.handler.SoapActionOutHandler in phase transport [19 16:44:54.171] DEBUG [HandlerPipeline] - Invoking phase send [19 16:44:54.171] DEBUG [HandlerPipeline] - Invoking handler org.codehaus.xfire.handler.OutMessageSender in phase send [19 16:44:55.187] DEBUG [Client] - Received message to http://192.168.253.174:7878/Oculus5/services/FederatedService [19 16:44:55.187] DEBUG [HandlerPipeline] - adding handler [EMAIL PROTECTED] to phase pre-dispatch [19 16:44:55.187] DEBUG [HandlerPipeline] - adding handler [EMAIL PROTECTED] to phase parse [19 16:44:55.187] DEBUG [HandlerPipeline] - adding handler [EMAIL PROTECTED] to phase pre-invoke [19 16:44:55.187] DEBUG [HandlerPipeline] - adding handler [EMAIL PROTECTED] to phase dispatch [19 16:44:55.187] DEBUG [HandlerPipeline] - adding handler [EMAIL PROTECTED] to phase dispatch [19 16:44:55.203] DEBUG [HandlerPipeline] - adding handler [EMAIL PROTECTED] to phase dispatch [19 16:44:55.203] DEBUG [HandlerPipeline] - Invoking phase transport [19 16:44:55.203] DEBUG [HandlerPipeline] - Invoking phase parse [19 16:44:55.203] DEBUG [HandlerPipeline] - Invoking handler org.codehaus.xfire.soap.handler.ReadHeadersHandler in phase parse [19 16:44:55.203] DEBUG [HandlerPipeline] - Invoking phase pre-dispatch [19 16:44:55.203] DEBUG [HandlerPipeline] - Invoking handler org.codehaus.xfire.client.CorrelatorHandler in phase pre-dispatch [19 16:44:55.203] DEBUG [Client] - Correlating context with ID 117701549415611512722899 [19 16:44:55.203] DEBUG [Client] - Found correlated context with ID 117701549415611512722899 [19 16:44:55.203] DEBUG [HandlerPipeline] - adding handler [EMAIL PROTECTED] to phase service [19 16:44:55.203] DEBUG [HandlerPipeline] - Invoking phase dispatch [19 16:44:55.203] DEBUG [HandlerPipeline] - Invoking handler org.codehaus.xfire.handler.LocateBindingHandler in phase dispatch [19 16:44:55.203] DEBUG [HandlerPipeline] - Invoking handler org.codehaus.xfire.soap.handler.SoapBodyHandler in phase dispatch [19 16:44:55.218] DEBUG [HandlerPipeline] - adding handler [EMAIL PROTECTED] to phase user [19 16:44:55.218] DEBUG [HandlerPipeline] - adding handler [EMAIL PROTECTED] to phase pre-dispatch [19 16:44:55.218] DEBUG [HandlerPipeline] - adding handler [EMAIL PROTECTED] to phase post-invoke [19 16:44:55.218] DEBUG [HandlerPipeline] - Phase post-invoke does not exist. Skipping handler org.codehaus.xfire.soap.handler.FaultSoapSerializerHandler [19 16:44:55.218] DEBUG [HandlerPipeline] - Invoking phase transport [19 16:44:55.218] DEBUG [HandlerPipeline] - Invoking phase parse [19 16:44:55.218] DEBUG [HandlerPipeline] - Invoking phase pre-dispatch [19 16:44:55.218] DEBUG [HandlerPipeline] - Invoking handler org.codehaus.xfire.client.CorrelatorHandler in phase pre-dispatch [19 16:44:55.218] DEBUG [Client] - Correlating context with ID 117701549415611512722899 [19 16:44:55.218] DEBUG [Client] - Found correlated context with ID 117701549415611512722899 [19 16:44:55.218] DEBUG [HandlerPipeline] - adding handler [EMAIL PROTECTED] to phase service [19 16:44:55.218] DEBUG [HandlerPipeline] - Invoking phase dispatch [19 16:44:55.218] DEBUG [HandlerPipeline] - Invoking phase policy [19 16:44:55.218] DEBUG [HandlerPipeline] - Invoking phase user [19 16:44:55.218] DEBUG [HandlerPipeline] - Invoking handler org.codehaus.xfire.client.ClientFaultConverter in phase user [19 16:44:55.234] DEBUG [HandlerPipeline] - Invoking phase pre-invoke [19 16:44:55.234] DEBUG [HandlerPipeline] - Invoking phase service [19 16:44:55.234] DEBUG [HandlerPipeline] - Invoking handler org.codehaus.xfire.client.ClientReceiveHandler in phase service Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Fault: java.lang.NullPointerException org.codehaus.xfire.fault.XFireFault: Fault: java.lang.NullPointerException at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89) at org.codehaus.xfire.client.Client.onReceive(Client.java:391) at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:139) at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48) at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26) at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131) at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75) at org.codehaus.xfire.client.Client.invoke(Client.java:335) at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77) at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57) at $Proxy0.getDocument(Unknown Source) at com.roh.oculus.globalization.DocumentDownloader.main(DocumentDownloader.java:46) Caused by: java.lang.NullPointerException at org.codehaus.xfire.attachments.AttachmentUtil.getAttachment(AttachmentUtil.java:33) at org.codehaus.xfire.aegis.type.mtom.AbstractXOPType.readInclude(AbstractXOPType.java:58) at org.codehaus.xfire.aegis.type.mtom.AbstractXOPType.readObject(AbstractXOPType.java:45) at org.codehaus.xfire.aegis.AegisBindingProvider.readParameter(AegisBindingProvider.java:162) at org.codehaus.xfire.service.binding.AbstractBinding.read(AbstractBinding.java:206) at org.codehaus.xfire.service.binding.WrappedBinding.readMessage(WrappedBinding.java:50) at org.codehaus.xfire.soap.handler.SoapBodyHandler.invoke(SoapBodyHandler.java:42) at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131) at org.codehaus.xfire.client.Client.onReceive(Client.java:387) ... 10 more My modified code is public static void main(String[] args) throws MalformedURLException{ configLog4j(); logger.debug("Test Starts...."); Service serviceModel = new ObjectServiceFactory().create(FederatedService.class,"FederatedService","http://xfire.ws.oculus.roh.com",null); logger.debug("after serviceModel obtained"); FederatedService service = (FederatedService) new XFireProxyFactory().create(serviceModel, "http://192.168.253.174:7878/Oculus5/services/FederatedService"); logger.debug("Setup properties"); Client client = Client.getInstance(service); client.setProperty("mtom-enabled", "true"); client.setProperty(HttpTransport.CHUNKING_ENABLED, "true"); logger.debug("Properties set"); //String name = service.getSystemName(); //logger.debug("We are talking to: "+name); DataHandler handler = service.getDocument("c:/temp/log/OFS.log"); InputStream is = null; try { is = handler.getInputStream(); } catch (IOException e) { logger.error(e.getMessage()); // TODO Auto-generated catch block e.printStackTrace(); } logger.debug("Inputstream is here "); if (is instanceof DeleteOnCloseFileInputStream) { logger.debug("tell XFire not to delete the file"); ((DeleteOnCloseFileInputStream)is).setDelete(false); } AttachmentDataSource attSource = (AttachmentDataSource)handler.getDataSource(); logger.debug("Cast to AttachmentDataSource"); File file = attSource.getFile(); logger.debug(file.getName()+"is downloaded on client side"); logger.debug("path to file: "+file.getAbsolutePath()); } If I intercept my calls with tcpmon my request is POST /Oculus5/services/FederatedService HTTP/1.1 SOAPAction: "" Content-Type: multipart/related; type="application/xop+xml"; start="<[EMAIL PROTECTED]>"; start-info="text/xml"; boundary="----=_Part_0_3045408.1177015494453" User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; XFire Client +http://xfire.codehaus.org) Host: 192.168.253.174:7878 Expect: 100-continue Transfer-Encoding: chunked 23a ------=_Part_0_3045408.1177015494453 Content-Type: application/xop+xml; charset=UTF-8; type="text/xml" Content-Transfer-Encoding: 8bit Content-ID: <[EMAIL PROTECTED]> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><getDocument xmlns="http://xfire.ws.oculus.roh.com"><in0 xmlns="http://xfire.ws.oculus.roh.com">c:/temp/log/OFS.log</in0></getDocument></soap:Body></soap:Envelope> ------=_Part_0_3045408.1177015494453-- 0 And my service's responce is HTTP/1.1 100 Continue HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: multipart/related; type="application/xop+xml"; start="<[EMAIL PROTECTED]>"; start-info="text/xml"; boundary="----=_Part_2_30909476.1177015494984" Transfer-Encoding: chunked Date: Thu, 19 Apr 2007 20:44:54 GMT 2e3 ------=_Part_2_30909476.1177015494984 Content-Type: application/xop+xml; charset=UTF-8; type="text/xml" Content-Transfer-Encoding: 8bit Content-ID: <[EMAIL PROTECTED]> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><getDocumentResponse xmlns="http://xfire.ws.oculus.roh.com"><out xmlns="http://xfire.ws.oculus.roh.com" xmlns:ns1="http://www.w3.org/2004/11/xmlmime" ns1:mimeType="application/octet-stream"><Include xmlns="http://www.w3.org/2004/08/xop/include" href="cid:11770154949845-1956839353@http://www.w3.org/2001/XMLSchema" /></out></getDocumentResponse></soap:Body></soap:Envelope> 2000 ------=_Part_2_30909476.1177015494984 Content-Type: application/octet-stream Content-Transfer-Encoding: binary Content-ID: <[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema> log[19 15:57:42.546] DEBUG [DocumentDownloader] - Test Starts.... [19 15:57:43.125] DEBUG [DocumentDownloader] - after serviceModel obtained .......... .......... [19 16:44:54.171] DEBUG [HandlerPipeline] - Invoking phase send [19 16:44:54.171] DEBUG [HandlerPipeline] - Invoking handler org.codehaus.xfire.handler.OutMessageSender in phase send 2b ------=_Part_2_30909476.1177015494984-- 0 It looks that something wron with my client, isn't it? -- View this message in context: http://www.nabble.com/MTOM.-Can-my-webservice-return-DataHandler--tf3607587.html#a10086784 Sent from the XFire - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
