node to stream

Hello All,

External system is invoking webMethods flow service via http and sending XML. I have to store the whole content into a file system.

I had done this using xmlNodeToDocument, documentToXmlString and stored to file system. Sometimes incoming XML will be huge and converting to String is throwing OutOfMemory Exception.

Is there any way to convert the node into a stream?

I used objectToStream from PSUtilities package but it is throwing java.io.NotSerializableException.

Please advice.

Thanks,
Sateesh

Converting the node to a stream won’t do what you need–the node is an object representation of the entire XML document and is already completely in memory. You might consider the large document handling facilities. Depending on the version of IS you are using, there are some facilities provided out of the box.

I assume there is other processing being done rather than just writing the file to the file system–if not, then you should probably just use an FTP server for this rather than IS.

Thanks for quick response Rob,

We have to submit this XML to TN. So I thought instead of sending it directly to TN, store it in file system and then process the file from file system in chunks of records and submit to TN.

Here is what I am doing right now. May be you can guide me thru. I am creating a node iterator in the invoked flow service and dividing the whole file as set of 100 records and sending each set to TN after creating each set. Please advice.

But my concern is the whole data is loaded into memory as object, so this might cause OutOfMemory exception. Please let me know.

Thansk
Sateesh

Did you tried using TN LargeFileHandling capabilities?? may be you should go with it incase your XML directly posted to TN.

Please use search in the forum there are some detailed discussionsheld on TN largefile handling and setup/TSpace confiuguration,TN services to extract large datacontent etc…You can also check TNLargefilehandling Userguide as quick reference.

HTH,
RMG

I have already set up large file handling configuration. My question is before the data gettting into TN.

The set up in my company is External system posts XML data to IS thru http and IS has to submit data to TN.

You do know that IS and TN are the same environment, no? The large document handling of TN is the large document handling of IS. It is specifically this scenario (http post of large XML) that the large document handling addresses. What version of IS?

We are using 6.1 version of IS and TN. I do know that TN is enclosed within IS but I am not sure if large file handling configuration in TN will work for IS.

If it is the same, the large file would be stored in large doc configuration location and webMethods flow service should read from that file and submit to TN. Hope this is what you mean?

How is your Source XML (largefile) receiving to your IS/TN??Is your external trading partner/some other resource directlty posting it to your TN or is your IS flow generating it and routed to TN??

HTH,
RMG

External System is posting XML data to webMethods flow service via http. This posted XML does not have sender/receiverID and the flow service adds these tags to XML and inturn submits XML data to TN.

Sateesh,
How were you able to resolve this issue ?