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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  Issue in getting http response from Httpserver using webmethods java client

    Posted 12/11/03 07:28 AM

    Hi,

    I am working with webMethods java client, which invokes the service “pub.client:http” and gets the output, I am trying to read the html content in the form of bytes from IData object. while sending the http request I have used "bytes’ as output. I am facing a problem in printing the response what I received. The value is not printing. It is only printing the body part “[B@2b457f51”. I have tried using “bytesToString”, stil it is not solved.

    Please help me how to retrieve the HTML content. This issue is killing me since two days. Please help me in solving this issue.

    Thanks,
    Kumar


    The following tests conducted

    1. I have checked that my servlet got invoked successfully, and it returned from servlet without throwing any error at Http Server side.

    2. I have printed the Header part of http response at my webMethods client, it was printing successfully.


    The following is the piece of code at my webMethods client code.

    IData outputRecord3 = invoke(context, inputHTTPRecord, “pub.client:http”);

    //print output record
    GenUtil.printRec(outputRecord3, “OutputRecord 3”);

    //print body
    IDataCursor curser = outputRecord3.getCursor();
    curser.first(“body”);
    IData HttpData = (IData)curser.getValue();
    GenUtil.printRec(HttpData, “HTML Ouput”);

    //print actual content
    IDataCursor curser1 = HttpData.getCursor();
    curser1.first(“bytes”);
    System.out.println(curser1.getValue());


    #webmethods-Protocol-and-Transport
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Issue in getting http response from Httpserver using webmethods java client

    Posted 12/11/03 09:00 AM

    Hi Kumar,

    Call the service pub.string:bytesToString and then display the response.

    Janusz


    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport
    #webMethods


  • 3.  RE: Issue in getting http response from Httpserver using webmethods java client

    Posted 12/11/03 10:21 AM

    Hi Janusz,

    Thank You, actually I tried this previously also. But I was sending only bytes record while executing the service. Now I have used the entire body record to bytesToString, thats it, it is now working!.

    Thanks a lot!!!
    Kumar


    #webMethods
    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport