Instead of calling pub.json:jsonStreamToDocument, you could first call pub.file:streamToFile. This would write the raw content to a file. If the JSON document you’re getting is not large (or if you don’t expect the number of concurrent instances of this service to be large), you could even call pub.client:http with loadAs set to bytes instead of stream. This would prevent the need for resetting the input stream, or the need to read the contents from the file that you just wrote, in order to get the document (IData) you need for mapping.
If you use the bytes approach, you could:
(1) Call pub.file:bytesToFile to write the contents to a file
(2) Then call pub.string:bytesToString to convert the bytes to a string (alternatively, you could call pub.io:bytesToStream)
(3) Finally, call pub.json:jsonStringToDocument to get the JSON document (alternatively, if you called bytesToStream in #2, you could call jsonStreamToDocument in this step)
Hope this helps,
Percio
#webMethods#edi#Integration-Server-and-ESB