[wsf-c-dev] AXIOM NG
James Clark
james at wso2.com
Sat Dec 9 01:37:57 PST 2006
On Fri, 2006-12-08 at 21:16 +0600, Samisa Abeysinghe wrote:
> >> However, SOAP
> >> body would be USE_MANY most of the time.
> >>
> >
> > Why? If you're signing I guess it would have to be USE_MANY (unless we
> > can find some clever way to avoid this), but apart from that, I would
> > thought it would typically be USE_ONCE; it would up to the application
> > to make it USE_MANY if it needs to. What does the SOAP engine need to
> > do with the body apart from signing/encrypting? I guess you sometimes
> > need the name of root element of the payload for dispatching. What
> > else?
> >
> The current implementation peeks into the SOAP body to determine if
> there is a fault in the SOAP body.
I think the clean way to handle this is for the xml_reader interface to
do the peeking: on a start_element event, you would be able to tell the
xml_reader to hold on to it, and then on any event corresponding to a
descendant, you would be able to go back to that event. The xml_reader
will already need to have this kind of event buffering capability to
implement other methods.
Then the basic strategy for building a message context with an
xml_reader would be:
- Read to the envelope start-tag
- Save the envelope's attributes (need to figure out the best way to
represent these); probably useful to save the in-scope namespaces as
well
- Read to the header start-tag
- For each header-block start-element event, save the local name,
namespace URI and SOAP-defined attributes and then save the header-block
as an xml_element
- Read to the body start-tag
- Save the local name and namespace URI
- Tell the xml_reader to hang on to this event
- Read to the start-tag of the first child element (if any)
- Save the local name and namespace URI
- Go back to the body start-tag
- Tell the xml_reader to stop hanging on to this event
- Tell the xml_reader to make an xml_element out of the rest of the
document starting with this start-tag (but lazily give an error if
there's anything but comments and whitespace between the body end-tag
and the envelope end-tag)
All of these xml_element's would initially be USE_ONCE. But if any of
the handlers need to examine them (and not replace them), then the
handlers would need to make them USE_MANY first.
James
More information about the Wsf-c-dev
mailing list