You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by V D <st...@drexel.edu> on 2004/11/25 19:56:16 UTC
Big bug in Axis? DataHandler data is sent when making request without
any parameter
I have something like this:
DataHandler getData();
When a client call a server, the server send back a file (a
FileDataSource passing into a DataHandler instance). All good. The
client receive the data, wrap it in a BufferedReader and read all the
data, then close the reader stream.
However, when I call getData() again (after the first call), the client
waits for a long time.
Using a TcpMonitor, I was shocked to find out that the post from client
to the server also include most of the data in the file. Is this a
known bug?
It's seems a definitely a big bug in Axis, not my code. I don't know if
the communication choked because of this sending data from client, but
these are 2 big problems here. The first problem is data is sending
without specified so. The 2nd problem is the request hangs after some
data was sent back.
To reproduce the problem, follow these steps:
1) create an interface:
public interface TestService{
DataHandler getData();
}
2) Compile this interface and use Java2Wsdl to generate wsdl file
3) Use the generated wsdl file to generate all the stub, skeleton,
locator, whatever
4) Implement the service:
javax.activation.DataHandler data = null;
data = new javax.activation.DataHandler(new
FileDataSource("testfile.txt"));
return data;
5) Deploy the server code
6) Write a little client to call this twice, using a same stub obtained
from the locator
Also make sure to set the scope of this test service on the server to
"application" scope.
Please let me know if someone needs me to file this bug report.
Re: Big bug in Axis? DataHandler data is sent when making request
without any parameter
Posted by Vy Ho <st...@drexel.edu>.
Since this is a very serious problem and I haven't got any reponse,
please someone in the "know" throw me some bones on what's going on with
this. Is this being addressed? No body care? I need to file a bug
report for it to go anywhere? Already fixed in the nightly?
Thanks,
vh.
V D wrote:
>
> I have something like this:
>
> DataHandler getData();
>
> When a client call a server, the server send back a file (a
> FileDataSource passing into a DataHandler instance). All good. The
> client receive the data, wrap it in a BufferedReader and read all the
> data, then close the reader stream.
>
> However, when I call getData() again (after the first call), the
> client waits for a long time.
> Using a TcpMonitor, I was shocked to find out that the post from
> client to the server also include most of the data in the file. Is
> this a known bug?
>
> It's seems a definitely a big bug in Axis, not my code. I don't know
> if the communication choked because of this sending data from client,
> but these are 2 big problems here. The first problem is data is
> sending without specified so. The 2nd problem is the request hangs
> after some data was sent back.
>
> To reproduce the problem, follow these steps:
>
> 1) create an interface:
>
> public interface TestService{
> DataHandler getData();
> }
>
> 2) Compile this interface and use Java2Wsdl to generate wsdl file
>
> 3) Use the generated wsdl file to generate all the stub, skeleton,
> locator, whatever
>
> 4) Implement the service:
> javax.activation.DataHandler data = null;
> data = new javax.activation.DataHandler(new
> FileDataSource("testfile.txt"));
> return data;
>
> 5) Deploy the server code
>
> 6) Write a little client to call this twice, using a same stub
> obtained from the locator
>
> Also make sure to set the scope of this test service on the server to
> "application" scope.
>
> Please let me know if someone needs me to file this bug report.
>
>
Re: Big bug in Axis? DataHandler data is sent when making request
without any parameter
Posted by Vy Ho <st...@drexel.edu>.
Thanks to Roy Willy Haug, he sent me the following message which states
that he have had the same problem and found a way around it. I am not
sure the way he described is the end solution to the problem or not, but
it clearly indicates that this is indeed a bug, and should be an easy fix.
Here's the message:
Hi there,
It looks like I had the same problem as you describe. It turned out that
it was the Axis generated client-side SoapBindingStub that was in error.
Commenting out the setAttachments() and extractAttachments() in all
methods in the Axis-generated client-side SoapBindingStub.java solved
this problem for me.
... Snip from the ...SoapBindingStub.java ...
setRequestHeaders(_call);
//setAttachments(_call);
java.lang.Object _resp = _call.invoke(new java.lang.Object[]
{in0, new java.lang.Long(in1), in2.value});
... Snip from the ...SoapBindingStub.java ...
If you generate these stub-files automatically you will have to
rememeber to comment out these lines every time they are produced, or
change the script you use to do it for you.
I do not currently subscribe to the Axis mail list, and found no way to
answer directly to the list. Please feel free to provide this
information to the Axis list.
Regards,
Roy Willy Haug
Re: Big bug in Axis? DataHandler data is sent when making request
without any parameter
Posted by Vy Ho <st...@drexel.edu>.
When fixing this bug, please also note that why the client freezes up
when doing this (please check the first post). This could be a
potential bug if the api is changed to:
DataHandler echo(DataHandler data);
And the client call the server twice in succession. The 2nd time, the
client would use the returned DataHandler from the first call and pass
it to the server as the parameter. Ideally, this should work normally.
However, I haven't confirm if this case would cause problem or not.