3 Replies Latest reply on Dec 2, 2010 1:00 AM by 803272

    How recovery string from array bytes from a Web Service

      Hi All

      I know the String variables are serialible. However I am trying to convert a String varible to array bytes and send it by using a Web Service. This Web Service is used by application J2ME, when I trying to convert the array bytes to String and recovering the initial value of the string variable, this error shows:

      Expected Byte, received: Vlc0Z2MyRnNkV1J2

      In the console of J2ME application.

      The code of the Web Method is

      *@WebMethod(operationName = "retornarBytes")*
      *public byte[] retornarBytes() {*
      *//TODO write your implementation code here:*
      String mensaje="Un saludo";

      return mensaje.getBytes();
      The Web SErvice Client in Application J2ME, is generated by Netbeans (6.7.1) and the code to calling the Web Service from application J2ME is:

      *     PruebaWSService_Stub ws=new PruebaWSService_Stub();*
      *     byte[] bytes=ws.retornarBytes();*
      catch(IOException ex)
      *     System.out.println(ex.getMessage());*
      I hope you can help me. Thanks a lot

      Edited by: 800269 on 5/10/2010 01:52 PM