IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

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.


#TechXchangePresenter
 View Only
  • 1.  Convert document(record) to string

    Posted Wed June 14, 2006 04:53 PM

    Hi,

    I am stuck in a situation in shich i have to write a document(record)in WM 4.1 to an string. All the fields get appended to the string one after the other.
    Please help me how to do that.

    Your urgent help is appreciated.

    Thanks & Regards
    Amit


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


  • 2.  RE: Convert document(record) to string

    Posted Wed June 14, 2006 05:27 PM

    There is no such thing as WM 4.1.

    Assuming you mean webMethods B2B 4.01, there is a pub.record:recordToXMLValues built-in service that might do what you need.

    This is an ancient release of the product, so you may not easily be able to do what you want if that service does not do the trick.

    Mark


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


  • 3.  RE: Convert document(record) to string

    Posted Thu June 15, 2006 04:38 PM

    Hi Mark,

    Thanks for ur suggestions.
    I want to convert the whole record to be written in the form of string to a file. For eg :- (Employee is the record)

    Employee
    Name AMIT
    Adress PUNE
    Emp ID 502545

    I want the result as “AMITPUNE502545” to be in the text file.
    How should i go for it…
    Pls advice.

    Thanks for your valuable guidance

    Amit


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


  • 4.  RE: Convert document(record) to string

    Posted Thu June 15, 2006 04:53 PM

    Well, if you were using a more current release, you would use the Flat File Adapter. Since you using something from the dark ages, your options are very limited.

    You can write a java service that will “walk” the structure of your record appending the value of each key to the string. I can’t tell you how to do that in B2B 4.0.1. You are using B2B, right?

    Mark


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


  • 5.  RE: Convert document(record) to string

    Posted Thu June 15, 2006 05:16 PM

    Hi Amit
    If you can find the service pub.string:makeString, then you have some luck. Add a MAP step and map the Employee/Name to stringList[0], Employee/Address to stringList[1], Employee/EmpID to stringList[2] and so on… then call the service pub.string:makeString and supply this stringList with no delimiter the output of this service will have all the values concatenated.

    CAUTION: Keep in mind that if you don’t supply any delimeter as above, the resulting output string cannot by used for any parsing (until you know the lengths of the individiual fields and all the fields are of fixed width)

    HTH,
    Bhawesh.


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


  • 6.  RE: Convert document(record) to string

    Posted Fri June 30, 2006 12:39 PM

    Hi Bhavesh,

    Thanks for our help. One more advice… Now if have given all the strings and i want to combine them in to a single string,. (Using “makestring” service) inserting newline “\n” after every element. what should be the separtaor to be specified.

    i tried \n,‘\n’,%nl%,etc they are not working. also tried using
    \t,\r…

    Pls. let me know the corrcet syntax.

    Thanks for our help.

    Regards
    Amit


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


  • 7.  RE: Convert document(record) to string

    Posted Fri June 30, 2006 04:54 PM

    Amit,

    Here is the trick for newline,in makeString service input for delim
    do a setValue and rightclick view large editor and inside the box just hit enter and save it.

    you should see the \n line delimiter for each record in the output.

    HTH,
    RMG


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