• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with base64Binary

 
Theeranit Pongtongmuang
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've tried to send image to server via mobile and web service wsdl and got problem with base64binary type

For wsdl




When I put this wsdl in J2ME web service client and got

getbase64_func(byte[] image) method for sending image to server

So I've tried this code for MIDlet



and the result I got is the message server doesn 't encode data
I don't know why java parse base64binary to byte[] for getbase64_func method instead of string.
and I don't know the error that might happen converting Stringbase64 to byte[]

Please could you help me to solve this problem.

Thanks
 
Rakesh Jhamb
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please try below code

File f = new File(filename);
FileInputStream fin new FileInputStream(f);
byte[] buffer = new byte[(int)f.length()];
fin.read(buffer);
fin.close();

Don't use any Base64 encoding.

Now pass buffer to ws.getbase64_func method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic