Hi,
It's works with XFire generated client ( not the same client from Mtom
sample) .
I used both Tomcat 5.5 and Geronimo 1.1 on Windows. The client was in
intranet behind a firewall and server is in Internet with Apache Geronimo.
It was my fault. I had reading an InputStream twice ( first for size ).
I used XFire client and not CXF client because I didn't find out how to pass
a proxy username and password in CXF client ( it is another question of mine
on forum with no reply ).
Finally I built a complex application( without lists of objects) but I
limited only ( for moment of course ) for simple data type in
marshalling/unmarshalling that works without problems through corporate
proxy servers.
Thanks Dan
dkulp wrote:
>
> On Monday 06 August 2007 02:02, petrica wrote:
>> I have a CXF server and generate automatically a XFire client.
>> I used mtom sample from CXF distribution and testMtom function that
>> marshall/unmarshall a DataHandler INOUT parameter. The client will
>> send OK a file as an attachment through DataHandler parameter to
>> server , but it seems the server cannot send another file back to
>> client.
>> In example below, the file <server.zip> from testMtom server function
>> does not arrive on client side.
>
> The code looks OK to me. Couple of questions:
> 1) Does the client spit out any error or does it just return no data?
>
> 2) Is the server running in tomcat or is this a standalone? We
> discovered a bug in tomcat where the mtom headers were getting messed
> up. We've worked around the tomcat bug in the latest trunk code.
>
> 3) Any chance of getting a tcpdump of the response? I'd like to know if
> the data is on the wire or not. Since you seem to be using spring
> config on the server, you could just try adding:
> <jaxws:features>
> <bean class="org.apache.cxf.feature.LoggingFeature"/>
> </jaxws:features>
> and looking at the log output.
>
> 4) You could also try something similar to what you are doing on the
> client side: create a ByteArrayDataSource and use a DataHandler
> wrapping that. It's POSSIBLE that something isn't working with the
> FileDataSource.
>
> Dan
>
>
>>
>> 1. I activated in client and server optiopns for MTOM ( <mtom.enabled
>> >) In client -> client.setProperty("mtom-enabled", "true"); In server
>> -> <jaxws:properties> <entry key="mtom-enabled" value="true"/> .....
>>
>> 2. Alocate an instance of DataHandler on client :
>>
>> Holder<DataHandler> handler = new Holder<DataHandler>();
>> byte[] data = new byte[(int) fileSize];
>> new FileInputStream("c:\\temp\\client.zip").read(data);
>> handler.value = new DataHandler(new ByteArrayDataSource(data,
>> "application/octet-stream"));
>>
>> MtomType xpMtom = new MtomType();
>> xpMtom.setAttachinfo( handler.value );
>> service.testMtom( xpMtom );
>>
>> 3. On server :
>> void testMtom( Holder<DataHandler> attachinfo) {
>> InputStream mtomIn = attachinfo.value.getInputStream();
>> long fileSize = 0;
>> for (int i = mtomIn.read(); i != -1; i = mtomIn.read()) {
>> fileSize++;
>> }
>> System.out.println("The image holder data length is " +
>> mtomIn.available());
>>
>> attachinfo.value = new DataHandler( new
>> FileDataSource("c:\\temp\\server.zip") );
>> }
>>
>> Where is the mistake ?
>>
>> Can anybody give me an advice
>>
>> Any help is appreciated,
>> Petrica
>
> --
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727 C: 508-380-7194
> [EMAIL PROTECTED]
> http://www.dankulp.com/blog
>
>
--
View this message in context:
http://www.nabble.com/CXF-server-with-XFire-generated-client---problem-with-returning-a-type-DataHandler-with-MTOM-tf4222406.html#a12033569
Sent from the cxf-user mailing list archive at Nabble.com.