Issue in getting http response from Httpserver using webmethods java client

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());

Hi Kumar,

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

Janusz

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