When I am running Axis 1.3 and trying to use message handlers. The point of my message handlers is to calculate the amount of overhead in the XML messages I am sending. To this end, I am taking a very simple view of what is necessary data, and what is overhead: everything in tags (< and >) is overhead and all text in between is useful data.
In case this helps, I am using document literal wrapped style SOAP messages. In order to calculate the entire document size, I simply cast the MessageContext that comes into the handler as a SOAPMessageContext, call the getMessage method on that, send it to a ByteArrayOutputStream using the writeTo method, and call the size method on that stream. Calculating the size of the text in between elements uses a recursive algorithm to traverse the document tree. I simply recursively expand any nodes that are an instance of SOAPElement until I reach a Text node. Once I reach a Text node, I propagate the length of that string up the tree, summing the whole way. I use this same algorithm on both request and response sides. The request is extremely simple, so I have no problem calculating the size there, but the response seems to simply quit traversing the document tree once it gets to a node that is a holder class for wrapper-style parameter passing. It also never recognizes that a node is an instance of a Text node. This would seem to be an issue with the handler implementation code at first glance. However, I used TCPMon to send exactly the same message to the web service, knowing full well that the service will choke on its format. The issue here, however, is that the handler code executes first and doesn't care about its format aside from the fact that it is SOAP compatible. Now, the same message coming in and being handled by handleRequest instead of handleResponse traverses the full document tree and sums up the Text nodes correctly. This same thing happens regardless of the size of either request or response message. Is this a known issue with my version of Axis? Am I doing something completely wrong? I can provide code and sample data if necessary. I am reluctant to do so here because there are so many interacting pieces. Thank you in advance for any assistance you can offer. Jon Carmignani --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
