documeneToXMLString takes around 2 minutes to convert Document to XML String for around 50 K of sales Invoice records…But this above code is failing at xmlStringToXMLNode service . The IS is getting hanged and only option I have is to kill the IS java process and Sometimes I gives me out of Memory Error. I found couple of post stating to work with node iterator instead of loading entire document.
I guess pub.xml:getXMLNodeIterator and pub.xml:getNextXMLNode would not work in my case !!
How can I work with node iterator in my above case.
Also is their any other efficient way in which I can route the document to TN.
Built in webMethods service like pub.xml:getXMLNodeIterator takes input as com.wm.lang.xml.Node XML node and returns iterator.
Once we have an iterator we can parse data chunk by chunk through pub.xml:getNextXMLNode service.
Now in my case I am actually trying to convert IData document or XML String into an com.wm.lang.xml.Node XML node.
So I guess the webMethods solution works fine when are converting or parsing com.wm.lang.xml.Node XML node to Idata or to an XML String but not vice versa.
Do let me know if I am wrong.
I have tried running wm.tn.doc.xml:recordToBizdoc service. But even with this service my IS became un responsive and i had to kill its java process.
One more things i would like to share, it might to usefull to someone else.
I had this same problem with documentToXMLString service. After banging my head for a while I figured out that the I was not setting the buffer size in the input for documentToXMLString and also [FONT=Courier][SIZE=1]
watt.server.recordToDocument.bufferSize was set to default value. After changing this value documentToXMLString which was before taking more then a hour or somtimes even getting failed took less then 2 minutes to convert the entire IS document to XML String.
But the problem still remains to convert XMLString to XML Node. !!
If the problem is storing document inside TN, maybe you should try the following work around:
Convert document you have to string and then to stream (either by stringToBytes, bytesToStream or by writing to temp file and streaming from there)
Create a simple xml (envelope) and route it to TN for recognision
Get bizdoc which is sent back from previous step and a add new content part to it (your actual file), which will be streamed to TN instead of being uploaded whole into memory.
Of cource proper doc type must be defined on TN. Once you route it to TN, you receive back a bizdoc representing this document (let’s call it envelope). Now invoke wm.tn.doc:addContentPart to add actual document as new content part (call it “payload” for example) to envelope. Make sure that TN is configured for large documents handling.
If at any later time you need to access payload (for transport or transformation purposes) you first get bizdoc for given envelope (for example query depending on document name and document id), and then invoke wm.tn.doc:getContentPartData and set getAs = stream. This will allow you to work on stream only and not to load full document into memory.
“1. Convert document you have to string and then to stream (either by stringToBytes, bytesToStream or by writing to temp file and streaming from there)”
Word of caution: bytesToStream doesn’t magically unload the bytes from memory. They are still there. To get something dropped from memory, it needs to be written to disk, then the stream opened against the file.
The wm.tn.doc.xml:routeXml is not returning Bizdoc document in the output. The xml envelope routed is being recognized by TN and its also invoking the serivce defined in the action of processing rule.
I am calling the routeXML service from flow service. Is the bizdoc not returned because of this ?
routeXML should return bizdoc (among other output variables). trace it’s behaviour step by step, maybe you drop bizdoc somewhere in the middle. is bizdoc returned after recognize step in routeXML?
I am leaving on holidays on Monday for 2 weeks, so I won’t be able to respond till 13th May. good luck.