webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

converting string to binary data

  • 1.  converting string to binary data

    Posted Fri September 19, 2008 09:21 AM

    Is there any builtin services available in webMethods to convert string formate to binary data(1’s and 0’s).


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: converting string to binary data

    Posted Fri September 19, 2008 07:26 PM

    wmPublic/pub.string.stringToBytes is that wht you want? if so plz check the Built-In Services before you post something like that.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: converting string to binary data

    Posted Fri September 19, 2008 09:29 PM

    Pavan,

    There is no builtIn service to convert string to binary data, you have to write a java service for that. Just google it and you will find several sample codes for it.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: converting string to binary data

    Posted Tue September 23, 2008 01:49 PM

    do you have any idea about how to convert string into binary(1’s and 0’s) data


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: converting string to binary data



  • 6.  RE: converting string to binary data

    Posted Wed September 24, 2008 12:51 AM


  • 7.  RE: converting string to binary data

    Posted Wed September 24, 2008 02:51 PM

    we are getting xml file we need to convert whole file into binary data(1’s and 0’s).we have developed code which will convert string into binary but it is working for small string whenever we are passing huge data we are getting number formate exception.
    please share your experience.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 8.  RE: converting string to binary data

    Posted Wed September 24, 2008 02:54 PM

    Please use the build-in service:pub:stringtobytes.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 9.  RE: converting string to binary data

    Posted Wed September 24, 2008 03:32 PM

    We have no idea that stringToBytes is what pavankumar wants.

    I’m still confused by the requirement. As I said, a string is already ones and zeros.

    Various ways to understand the requirement:

    1. Equivalent of Java String.toByteArray() or String.toCharArray()
    2. Equivalent of Java Integer.parseInt(String), Long.parseLong(String) etc.
      That is, “40” converts to a native type with value of 40.
    3. As (2.), but convert the result into a string of "1"s and "0"s.
      That is “5” converts to the string “101”
    4. And many more…

    Let’s really understand the requirement before prescribing solutions.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 10.  RE: converting string to binary data

    Posted Thu September 25, 2008 07:36 AM

    Thanks for your response
    service:pub:stringtobytes this service returns bytes not binary data.
    I need binary data 1’s and 0’s.
    I am getting Like purchase order in xml file
    i need to convrt that purchase order into binary formate 1’s and 0’s.
    U got my requirement in 3 rd step.(above)
    please let me know if need any information


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 11.  RE: converting string to binary data

    Posted Thu September 25, 2008 10:58 AM

    OK, so what you are asking, is how to convert a number encoded as a decimal string, into a number encoded in a binary string.


    String subject=“5”;
    Long num = Long.parseLong(subject);
    String binaryString = Long.toString(num,2);
    System.out.println(binaryString);

    Prints ‘101’.

    It’s a very unusual requirement and an extremely inefficient way of storing values. May I ask why you need it?


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 12.  RE: converting string to binary data

    Posted Thu September 25, 2008 01:54 PM

    read the xml file and convert it into EBCDIC number formate you will get it in hexadecimal form next convert it into binary but you have to read the data twice which is time consuming


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 13.  RE: converting string to binary data

    Posted Thu September 25, 2008 04:51 PM

    Might this be a language issue? You keep referring to needing “binary data” but a byte is binary data.

    Are you talking about converting numbers represented as strings in an XML purchase order to a numeric data type? For example, getting the string “10” converted to the integer 10? Or a date string converted to a Date object?


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services