aspose file tools*
The moose likes Web Services and the fly likes calling .net Webservice from Java with byte[] param Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "calling .net Webservice from Java with byte[] param" Watch "calling .net Webservice from Java with byte[] param" New topic
Author

calling .net Webservice from Java with byte[] param

Markus Jesner
Greenhorn

Joined: Nov 16, 2011
Posts: 4
Hello,

I've an .net webservice which has a byte[] as parameter in the webmethod.
I've generated classes with java2wsdl (cxf-2.2.12). When I try to call the method with a "simple" byteArray like "xxx".getBytes(), everything will work fine.
But when I try to call the method with a byte[] from a BLOB (database) oder a file (read as byte[]), I'll get response code 400 (bad request) and an exception
in cxf. Also tried to get bytes from a long string (xml message) with .getBytes() .. same error (400) will occur.



I set the maximum bytes for the webservice (in .net) up to 16MB and the files/blob have only 1-5 KB.

I'm not sure where there is a problem? Maybe the length of the byte[]? or some encoding issues?

Any ideas?

Thank you very much,
Markus
Markus Jesner
Greenhorn

Joined: Nov 16, 2011
Posts: 4
The problem was the timeout. you have to set this like this

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: calling .net Webservice from Java with byte[] param