I don't think you need this entry in aegis mapping. On 11/23/06, ying lcs <[EMAIL PROTECTED]> wrote:
The only thing that i think of which may be wrong is my aegis.xml file for my service.I put this for my 'public DataSource getLog()" function. <method name="getLog"> <return-type componentType="javax.activation.DataSource" /> </method> I wonder if there is anything else I need to do in order to transfer a file. I already enable MTOM support in my services.xml file: <properties> <property key="mtom-enabled">true </property> </properties> On 11/23/06, ying lcs <[EMAIL PROTECTED]> wrote: > Tomek, > > Thanks for your continous help. I really appreciate it. > > I did add code the server side to load and print the file that i want to send. > I did see the full content on the screen (tomcat console) and the > message 'done created'. > > So I think my datasource on the server side is okay. For some reason, > that file is not being send. > > Thanks for any more ideas. > > > // my code on the server side: > > public DataSource getLog() { > System.out.println(" getLog is getting called"); > > try { > > DataSource ds1 = new FileDataSource(getTestFile("deviceCode.txt")); > > InputStream is = ds1.getInputStream(); > > try > { > final byte[] buffer = new byte[8096]; > > int n = 0; > while (-1 != (n = is.read(buffer))) > { > System.out.write(buffer, 0, n); > } > } > finally > { > > is.close(); > } > > DataSource ds = new FileDataSource(getTestFile("deviceCode.txt")); > > System.out.println("done created!"); > > return ds; > > } catch (Throwable t) { > t.printStackTrace(); > } > return null; > > On 11/23/06, Tomek Sztelak <[EMAIL PROTECTED]> wrote: > > I don't see file content inside response. Check if your datasource > > works correctly, e.g. add some code on server side,which load and > > print data from file, instead of sending it. > > > > On 11/23/06, ying lcs <[EMAIL PROTECTED]> wrote: > > > Tomek, > > > > > > I am able to capute the SOAP message via the tcpmon. Can you please > > > point me to where should I look at? Is this a server error? or a > > > client error? > > > > > > Thank you for your help again. > > > > > > Here is the request: > > > > > > POST /testwebap/services/BookService HTTP/1.1 > > > SOAPAction: "" > > > Content-Type: multipart/related; type="application/xop+xml"; > > > start="<[EMAIL PROTECTED]>"; start-info="text/xml"; > > > boundary="----=_Part_0_26867996.1164263528159" > > > User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; XFire > > > Client +http://xfire.codehaus.org) > > > Host: localhost:9090 > > > Expect: 100-continue > > > Content-Length: 591 > > > > > > > > > ------=_Part_0_26867996.1164263528159 > > > 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:Header><version > > > xmlns="http://com.novarra.downloadserver/Book">1.0</version></soap:Header><soap:Body><getLog > > > xmlns="http://xfire.codehaus.org/BookService" > > > /></soap:Body></soap:Envelope> > > > ------=_Part_0_26867996.1164263528159-- > > > > > > > > > > > > ------=_Part_0_26867996.1164263528159 > > > 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:Header><version > > > xmlns="http://com.testapp/Book">1.0</version></soap:Header><soap:Body><getLog > > > xmlns="http://xfire.codehaus.org/BookService" > > > /></soap:Body></soap:Envelope> > > > ------=_Part_0_26867996.1164263528159-- > > > > > > HTTP/1.1 100 Continue > > > > > > HTTP/1.1 200 OK > > > Server: Apache-Coyote/1.1 > > > Content-Type: text/xml;charset=UTF-8 > > > Transfer-Encoding: chunked > > > Date: Thu, 23 Nov 2006 06:32:08 GMT > > > > > > 1f2 > > > <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><getLogResponse > > > xmlns="http://xfire.codehaus.org/ConfigService"><out > > > xmlns:ns1="http://www.w3.org/2004/11/xmlmime" > > > ns1:mimeType="text/plain"><Include > > > xmlns="http://www.w3.org/2004/08/xop/include" > > > href="cid:116426352864531486097695@http://www.w3.org/2001/XMLSchema" > > > /></out></getLogResponse></soap:Body></soap:Envelope> > > > 0 > > > > > > > > > > > > On 11/22/06, Tomek Sztelak <[EMAIL PROTECTED]> wrote: > > > > You can start to debug server side and check if file is loaded. > > > > You can also use https://tcpmon.dev.java.net/ to intercept soap message. > > > > > > > > On 11/22/06, ying lcs <[EMAIL PROTECTED]> wrote: > > > > > Can you please tell me how can I check the SOAP message? Is there a > > > > > SOAP message monitor on the xfire client side? > > > > > > > > > > I am running the server side on linux. > > > > > And I put already put absolute path to the file. The file is just a > > > > > small ~10K text file. > > > > > public DataSource getLog() { > > > > > return new FileDataSource("/home/ying/code.txt"); > > > > > } > > > > > > > > > > On 11/22/06, Tomek Sztelak <[EMAIL PROTECTED]> wrote: > > > > > > Try to check if file data is send in soap message. Maybe its problem > > > > > > with loading file. > > > > > > > > > > > > On 11/22/06, ying lcs <[EMAIL PROTECTED]> wrote: > > > > > > > I am using the one comes with xfire-1.2.2. > > > > > > > I am using mail-1.4.jar and activation-1.1.jar. > > > > > > > > > > > > > > In my case, I want my Webservice client to download a file from a > > > > > > > WebService server. > > > > > > > So I just define this method in myserver.aegis.xml: > > > > > > > > > > > > > > <method name="getLog"> > > > > > > > <return-type componentType="javax.activation.DataSource" /> > > > > > > > > > > > > > > </method> > > > > > > > > > > > > > > And in my interface class on the server sdie, I just have this; > > > > > > > public DataSource getLog() > > > > > > > { > > > > > > > > > > > > > > return new FileDataSource("/home/yinglcs/test.txt"); > > > > > > > > > > > > > > } > > > > > > > > > > > > > > That should be sufficient, right? > > > > > > > If not can you please tell me what am I missing? > > > > > > > > > > > > > > e.g. Do I need a DataHandler in the interface? If yes, why? > > > > > > > > > > > > > > Thanks for any more help. > > > > > > > > > > > > > > > > > > > > > On 11/22/06, Tomek Sztelak <[EMAIL PROTECTED]> wrote: > > > > > > > > Hmm, as i remember this error can also by caused by wrong version of > > > > > > > > java mail.jar. Can you check what version are you using ? > > > > > > > > > > > > > > > > On 11/22/06, ying lcs <[EMAIL PROTECTED]> wrote: > > > > > > > > > Yes, I did. > > > > > > > > > > > > > > > > > > What I am trying to do is to have the WebService client get the file > > > > > > > > > from the WebService server. I think that is why I am studying the > > > > > > > > > 'Picture' test case in the xfire source. > > > > > > > > > But I can't get it to work. I get this exception: > > > > > > > > > > > > > > > > > > > xception in thread "main" org.codehaus.xfire.XFireRuntimeException: > > > > > > > > > > > Could not invoke service.. Nested exception is > > > > > > > > > > > org.codehaus.xfire.fault.XFireFault: Could not find the attachment > > > > > > > > > > > cid:116422501819961235202990@http://www.w3.org/2001/XMLSchema > > > > > > > > > > > org.codehaus.xfire.fault.XFireFault: Could not find the attachment > > > > > > > > > > > cid:116422501819961235202990@http://www.w3.org/2001/XMLSchema > > > > > > > > > > > at org.codehaus.xfire.aegis.type.mtom.AbstractXOPType.readInclude(AbstractXOPType.java:62) > > > > > > > > > > > at org.codehaus.xfire.aegis.type.mtom.AbstractXOPType.readObject(AbstractXOPType.java:45) > > > > > > > > > > > at org.codehaus.xfire.aegis.AegisBindingProvider.readParameter(AegisBindingProvider.java:154) > > > > > > > > > > > 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:382) > > > > > > > > > > > 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.getLog(Unknown Source) > > > > > > > > > > > at org.codehaus.xfire.demo.BookClient.main(BookClient.java:78) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On 11/22/06, Tomek Sztelak <[EMAIL PROTECTED]> wrote: > > > > > > > > > > Did you set "mtom-eneble"=true on client side ? Check examples/mtom sample app. > > > > > > > > > > > > > > > > > > > > On 11/22/06, ying lcs <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > Thanks for the pointer. I also read the "picture " example in > > > > > > > > > > > xfire-aegis to see how POJO works in transferring a file. > > > > > > > > > > > > > > > > > > > > > > I did: > > > > > > > > > > > > > > > > > > > > > > 1. add a method in my Service Interface: > > > > > > > > > > > public DataSource getFile(String name) > > > > > > > > > > > > > > > > > > > > > > 2. enable mtom in my service.xml > > > > > > > > > > > <properties> > > > > > > > > > > > <property key="mtom-enabled">true </property> > > > > > > > > > > > </properties> > > > > > > > > > > > > > > > > > > > > > > 3. implement getFile in the imple of my service: > > > > > > > > > > > public DataSource getLog() > > > > > > > > > > > { > > > > > > > > > > > try { > > > > > > > > > > > // did break here when I set a breakpoint > > > > > > > > > > > return new FileDataSource("/home/yinglcs/deviceCode.txt"); > > > > > > > > > > > } catch (Exception e) { > > > > > > > > > > > // no exception thrown > > > > > > > > > > > e.printStackTrace(); > > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > return null; > > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > 4. In my web service client, I call the getLog like this: > > > > > > > > > > > DataSource source = service.getLog(); > > > > > > > > > > > > > > > > > > > > > > InputStream input = source.getInputStream(); > > > > > > > > > > > > > > > > > > > > > > 5. But I get this exception, Can you please tell me why it can't find > > > > > > > > > > > the attachment id? > > > > > > > > > > > > > > > > > > > > > > xception in thread "main" org.codehaus.xfire.XFireRuntimeException: > > > > > > > > > > > Could not invoke service.. Nested exception is > > > > > > > > > > > org.codehaus.xfire.fault.XFireFault: Could not find the attachment > > > > > > > > > > > cid:116422501819961235202990@http://www.w3.org/2001/XMLSchema > > > > > > > > > > > org.codehaus.xfire.fault.XFireFault: Could not find the attachment > > > > > > > > > > > cid:116422501819961235202990@http://www.w3.org/2001/XMLSchema > > > > > > > > > > > at org.codehaus.xfire.aegis.type.mtom.AbstractXOPType.readInclude(AbstractXOPType.java:62) > > > > > > > > > > > at org.codehaus.xfire.aegis.type.mtom.AbstractXOPType.readObject(AbstractXOPType.java:45) > > > > > > > > > > > at org.codehaus.xfire.aegis.AegisBindingProvider.readParameter(AegisBindingProvider.java:154) > > > > > > > > > > > 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:382) > > > > > > > > > > > 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.getLog(Unknown Source) > > > > > > > > > > > at org.codehaus.xfire.demo.BookClient.main(BookClient.java:78) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On 11/21/06, Tomek Sztelak <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > Sure, take a look here : http://xfire.codehaus.org/MTOM > > > > > > > > > > > > > > > > > > > > > > > > On 11/21/06, ying lcs <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > > > > > > > > > > > > > Can I use xfire to transfer file using SOAP? > > > > > > > > > > > > > > > > > > > > > > > > > > Thank you. > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > > > > > > > > > To unsubscribe from this list please visit: > > > > > > > > > > > > > > > > > > > > > > > > > > http://xircles.codehaus.org/manage_email > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > > > ----- > > > > > > > > > > > > When one of our products stops working, we'll blame another vendor > > > > > > > > > > > > within 24 hours. > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > > > > > > > > To unsubscribe from this list please visit: > > > > > > > > > > > > > > > > > > > > > > > > http://xircles.codehaus.org/manage_email > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > > > > > > > To unsubscribe from this list please visit: > > > > > > > > > > > > > > > > > > > > > > http://xircles.codehaus.org/manage_email > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > ----- > > > > > > > > > > When one of our products stops working, we'll blame another vendor > > > > > > > > > > within 24 hours. > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > > > > > > To unsubscribe from this list please visit: > > > > > > > > > > > > > > > > > > > > http://xircles.codehaus.org/manage_email > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > > > > > To unsubscribe from this list please visit: > > > > > > > > > > > > > > > > > > http://xircles.codehaus.org/manage_email > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > ----- > > > > > > > > When one of our products stops working, we'll blame another vendor > > > > > > > > within 24 hours. > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > > > > To unsubscribe from this list please visit: > > > > > > > > > > > > > > > > http://xircles.codehaus.org/manage_email > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > > > To unsubscribe from this list please visit: > > > > > > > > > > > > > > http://xircles.codehaus.org/manage_email > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > ----- > > > > > > When one of our products stops working, we'll blame another vendor > > > > > > within 24 hours. > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > > To unsubscribe from this list please visit: > > > > > > > > > > > > http://xircles.codehaus.org/manage_email > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > To unsubscribe from this list please visit: > > > > > > > > > > http://xircles.codehaus.org/manage_email > > > > > > > > > > > > > > > > > > > > > > -- > > > > ----- > > > > When one of our products stops working, we'll blame another vendor > > > > within 24 hours. > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe from this list please visit: > > > > > > > > http://xircles.codehaus.org/manage_email > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe from this list please visit: > > > > > > http://xircles.codehaus.org/manage_email > > > > > > > > > > > > -- > > ----- > > When one of our products stops working, we'll blame another vendor > > within 24 hours. > > > > --------------------------------------------------------------------- > > To unsubscribe from this list please visit: > > > > http://xircles.codehaus.org/manage_email > > > > > --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
-- ----- When one of our products stops working, we'll blame another vendor within 24 hours. --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
