Convert one filed to base64binary (byte)

I have a file to webservice scenario in which all fileds that are input to the webservice are string so I map them from the source side after applyign graphical functions.. but one field in target side has a data type base64Binary
Is this same as byte? or this is base64ecoding?
Also can you please let me know I can accomplish the mapping usign UDF?
when I do a return inputstring.getBytes() , its throwing an error
Regards,
Tej

HI  Ravi,
Is this same as byte? or this is base64ecoding?
This represents an encoding of a binary file, but the representation is in base64. With base64 you can get text or binary data but the algorithm is the same. It is base64encoding
Also can you please let me know I can accomplish the mapping usign UDF?
I think that you want to take the file a converting it in base64 and to set a XML tag with this value.
You can use a java mapping to do this. You use the file adapter to take the file and later in the java mapping you do the base64 conversion:
1. To read a file and to deal with it in java mapping: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee56c0b?QuickLink=index&…
2. Conversion to base64 of an inputstream: How do you convert an InputStream to a base64 string in Scala? - Stack Overflow
3. Finally, you take this result and string and you converts the target XML manually.
Regards.

Similar Messages

  • Converting a long to a byte

    Hi,
    Is there any way to convert a long to a byte. will byteValue() help?i have tried with it, but i get an error saying "long cannot be dereferenced.
    long tag = 1231200;
    byte[] newtag = tag.byteValue();Please tell me why i get this error and help me solve it.
    Thanks in advance

    Is there any way to convert a long to a byte. willbyte b = (byte) 1234567890L;
    byteValue() help?Depends on what you try to do do. Just how are you converting 1000L to one byte?
    i have tried with it, but i get an
    error saying "long cannot be dereferenced.
    Please tell me why i get this error and help me solve
    it.You get this error because you don't know the differences between long and Long, or primitive data types and objects.
    new Long(myLong).byteValue()

  • Converting unsigned to java signed byte value

    Hey ,
    i need to use a raw address in a client i am writing but, of course, the address contains a byte outside of the java signed byte range. if any one could tell me what an unsigned byte of 224 in signed java is i would be very grateful, if you could also show how you did this it would be appreciated. thank you =)

    Re: Converting unsigned to java signed byte value
    i need to use a raw address in a client i am writing
    but, of course, the address contains a byte outside
    of the java signed byte range.
    if any one could tell
    me what an unsigned byte of 224 is in signed java
    I would be very grateful, if you could also show how
    you did this it would be appreciated. thank you =)You misunderstand signed/unsigned.
    A byte has 8 bits. It can represent 256 different values.
    Viewed as an unsigned scalar the range is [0;255].
    Viewed as a signed two's-complement scalar the range is [-128;127].
    Values [0;127] are obviously the same byte values in the two views.
    What the other half of the possible byte values represent depends on what view you adopt.
    You don't need to convert anything.
    public final class Byte224 {
        static byte[] byteArray = {
            (byte)224, (byte)'\n'
        public static final void main(final String[] arg) {
            System.out.println("0x"+Integer.toHexString(byteArray[0]&0xff));
            System.out.println(Integer.toString(byteArray[0]&0xff));
    }

  • How can I make a pdf book with "camera to pdf" option on phone? I can only convert one pic at a time

    How can I make a pdf book (single pdf file with several pages)  with "camera to pdf" option on phone? I can only convert one pic at a time. ( Or )how can I attach all those pictures converted pdf's into one pdf file which obviously results in to a single pdf file with several pages in it ?

    Adobe Reader on the iPhone is a PDF reading app. It's not a creation app.
    You need to get an app like Pages which is intended for page layout. It can place pictures from the phone and export PDF.

  • How to convert an Image to a byte array?

    I want to make a screenshot and then convert the image to a byte of arrays so I can send it through a BufferedOutputStream.
    try
                   robot = new Robot();
                   screenshot = robot.createScreenCapture(new Rectangle(500,500));
                   imageFile = new File("image.png");
                   ImageInputStream iis = ImageIO.createImageInputStream(screenshot);
                   byte[] data = new byte[1024];
                   byte[] tmp = new byte[0];
                   byte[] myArrayImage = new byte[0];
                   int len = 0;
                   int total = 0;
                   while((len = iis.read(data)) != -1 ) // LINE 52 --- EXCEPTION CATCHED HERE
                        total += len;
                        tmp = myArrayImage;
                        myArrayImage = new byte[total];
                        System.arraycopy(tmp,0,myArrayImage,0,tmp.length);
                        System.arraycopy(data,0,myArrayImage,tmp.length,len);
                   ios.close();I get this exception while running:
    Exception in thread "Thread-0" java.lang.NullPointerException
    at Server.run(Server.java:52)
    at java.lang.Thread.run(Unknown Source)

    Fixed that. I got a new problem.
    When I connect to my simple server application that reads the image file, converts it to an array of bytes and sends it back, the file is created on the client side and it containts data, but I am not able to open the image. I have checked that the image that the server is sending is working. So where is the problem?
    The client application recieves the image as following:
    public void run()
            try
                socket = new Socket("127.0.0.1", 2000);
                BufferedOutputStream out_file = new BufferedOutputStream(new FileOutputStream("recieved_img.png"));
                BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
                int inputLine;
                while((inputLine = in.read()) != -1)
                    char c = (char)inputLine;
                    System.out.println(c);
                    out_file.write(inputLine);
            catch(IOException err){ err.printStackTrace(); }
        }And the server sends the image like this;
    try
              socket = server.accept();
              in=new BufferedReader(new InputStreamReader(socket.getInputStream()));
              out = new BufferedOutputStream(socket.getOutputStream());
              out.write(25);
              while((inputLine = in.readLine()) != null)
                   System.out.println(myArrayImage.length);
              System.out.println(inputLine);
                        out.write(myArrayImage);     // Send the array of bytes
         }

  • Error message when I try to convert pdf to excel, after three attempts I could only convert one file.

    Error message when I try to convert pdf to excel, after three attempts I could only convert one file.

    Hi pdf to excel,
    What is the error that you're receiving when you try to convert? Is it the "Conversion Failure" message? Can you tell me more about the files you're unable to convert? What application created the PDFs? Are there many pages in these these files, or a complex mix of text and graphics?
    It'll also be helpful to know whether you're converting via the ExportPDF website (and what browser you're using), or through Adobe Reader.
    I look forward to hearing back from you, so we can get to the bottom of this!
    Best,
    Sara

  • Conversion from German to English to convert a filed of  table EKPO

    Hi Guys,
    I want to know how to convert a filed of particular table from German to English for EKPO-MEINS field. This is a unit of measure field which I'm checking from SE11, it shows it in german (LE instead of ACT, MON instead of MO etc). I'm using call function reuse_alv_grid_display and the output for all unit of measure fields are coming in german and other fields are coming in english. This problem arises after upgrade from 4.6c to ecc 6.0. In 4.6c it is working fine. Please tell me how to change it to english.
    Thanks,
    Awanish

    Hi,
    Sorry...Not sure what you are looking for..
    But the description says "Settlement type" for the field PERBZ
    Thanks,
    Naren

  • I have a book in pdf format and its to big to convert to word I just want to convert one chapter how do I do this?.

    How do I convert one chapter from a pdf book to word

    Hi charleschavez,
    It sounds like you've bumped up against the 100 MB file size limit imposed by ExportPDF and Adobe PDF Pack. To extract pages from the PDF, you can use Acrobat (try it for free for 30 days, if you'd like!). Then you can even use Acrobat to export those pages to Word format by choosing File > Save as Other > Microsoft Word > Word Document.
    Best,
    Sara

  • After sorting my pictures into albums, I  deleted them from the camera roll, now they're all gone. Including the ones filed in the albums. Would it be possible to get them back ?

    after sorting my pictures into albums, I deleted them from the camera roll, includings the ones filed in the albums. Would it e possible to get them back ?

    A photo in the Camera Roll cannot be in an album unless the photo remains in the Camera Roll. Photos in an album or not duplicated. A photo in an album includes a pointer to the original photo stored in the Camera Roll. The Camera Roll is for temporary storage. Photos/videos can and should be imported by your computer as with any other digital camera.
    The Camera Roll is included with your iPhone's backup. If your iPhone's backup has been updated to include all photos that were in the Camera Roll and has not been updated since the photos were deleted, you can try restoring your iPhone from your iPhone's backup. Do not update your iPhone's backup before doing so and decline the prompt to update your iPhone's backup as the first step after selecting Restore.

  • I've just updated my Macbook to Mavericks and all my .avi files storaged in a Lacie Rugged aren't opening but converting one by one I opened; are they not compatible?. Is there a way to converting all of them simultaneously and faster? Thanks a lot guys

    I've just updated my Macbook to Mavericks and all my .avi files storaged in a Lacie Rugged aren't opening but converting one by one I opened; are they not compatible?. Is there a way to converting all of them simultaneously and faster? Thanks a lot guys

    Have you tried using VLC media player it seems to play almost any codec without converting.
    https://www.macupdate.com/app/mac/5758/vlc-media-player

  • When iTunes converts one song format to anothet eg from AAC to MP4 where is the MP4 version?

    when iTunes converts one song format to anothet eg from AAC to MP4 where is the MP4 version?

    Hello tomspoon
    Check in the Music Folder of your computer to locate the songs there, then just drag it back onto iTunes.
    Where are my iTunes files located?
    http://support.apple.com/kb/HT1391
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • Converting a string to a byte

    I need to know how to convert a string of 1s and 0s into a byte.
    For example, if the string were "10010001", how would I make it a byte?
    I looked at the API, and the Byte class doesn't seem to have the capability to do this.
    (I realize that this is probably an unconventional way of doing it, but I'm required to do it this way.)
    Thanks in advance.

    Okay, I realized why I was having trouble.
    I even tried the parse method with the radix parameter thing before and it didn't work, but that was because I was using an invalid bit. (11001001)
    That bit came from a randomly (well, pseudo-randomly) generated bunch of bits, so I just assumed that it would be good.
    The project I'm working on is a one-time pad cipher, and that bit was generated by a method given to me by the professor. I remember now that he mentioned in passing something about how in this case, the first bit is used as a "sign bit" and that a "1" represents negative.
    Sorry for wasting your time / frustrating you. Thanks for your help though.

  • How can I convert an Hexadecimal number in bytes

    Hello!
    I have a string wich represents an hexadecimal value ( ex: C2105215767E)
    I want to convert it into byte. I want to obtain an array of byte. I want to write it into a variable : byte[]var
    How can I do it?
    Thanks you for your answer.
    cordialy,
    lafon1

    Look into the API for BigInteger. You can use a constructor that takes a String and specify the radix as 16 (hex). Big Integer includes a method to convert to a byte array.

  • Trying to understand the details of converting an int to a byte[] and back

    I found the following code to convert ints into bytes and wanted to understand it better:
    public static final byte[] intToByteArray(int value) {
    return new byte[]{
    (byte)(value >>> 24), (byte)(value >> 16 & 0xff), (byte)(value >> 8 & 0xff), (byte)(value & 0xff) };
    }I understand that an int requires 4 bytes and that each byte allows for a power of 8. But, sadly, I can't figure out how to directly translate the code above? Can someone recommend a site that explains the following:
    1. >>> and >>
    2. Oxff.
    3. Masks vs. casts.
    thanks so much.

    By the way, people often introduce this redundancy (as in your example above):
    (byte)(i >> 8 & 0xFF)When this suffices:
    (byte)(i >> 8)Since by [JLS 5.1.3|http://java.sun.com/docs/books/jls/third_edition/html/conversions.html#25363] :
    A narrowing conversion of a signed integer to an integral type T simply discards all but the n lowest order bits, where n is the number of bits used to represent type T.Casting to a byte is merely keeping only the lower order 8 bits, and (anything & 0xFF) is simply clearing all but the lower order 8 bits. So it's redundant. Or I could just show you the more simple proof: try absolutely every value of int as an input and see if they ever differ:
       public static void main(String[] args) {
          for ( int i = Integer.MIN_VALUE;; i++ ) {
             if ( i % 100000000 == 0 ) {
                //report progress
                System.out.println("i=" + i);
             if ( (byte)(i >> 8 & 0xff) != (byte)(i >> 8) ) {
                System.out.println("ANOMOLY: " + i);
             if ( i == Integer.MAX_VALUE ) {
                break;
       }Needless to say, they don't ever differ. Where masking does matter is when you're widening (say from a byte to an int):
       public static void main(String[] args) {
          byte b = -1;
          int i = b;
          int j = b & 0xFF;
          System.out.println("i: " + i + " j: " + j);
       }That's because bytes are signed, and when you widen a signed negative integer to a wider integer, you get 1s in the higher bits, not 0s due to sign-extension. See [http://java.sun.com/docs/books/jls/third_edition/html/conversions.html#5.1.2]
    Edited by: endasil on 3-Dec-2009 4:53 PM

  • Convert one page to word

    How do I convert only one page to word from a pdf document?

    Hi help with converting,
    Was the PDF created from a scanned document? It could be that the particular document you're converting isn't well-formed, and that can lead to conversion errors. Please see Will Adobe ExportPDF convert both text and formatting inf…
    But, there are a few things you can try:
    Clear the browser cache and try again.
    Try a different web browser (see System requirements | Acrobat.com)
    Make sure that there are no firewall/proxy settings that could be limiting your access to the Intenet.
    Try those, and let us know how it goes.
    Best,
    Sara

Maybe you are looking for