NonStop SOAP 4.1 User's Manual

NOTE: You need not use the AXIOM document APIs if the service builds the response using
AXIOM APIs. The AXIOM document APIs interpret the hierarchy and relationship between the
elements in an XML message and generates the AXIOM node that mirrors the relationships in the
XML message. Unlike the AXIOM document APIs, when you use the AXIOM API to build the
AXIOM node, you need to set the relationships between the elements.
NonStop SOAP 4 uses the StAX parser to convert the XML payload into an AXIOM node. The
parser traverses the XML payload and converts the payload into the corresponding AXIOM node.
The StAX parser consumes the XML payload and produces an AXIOM document structure. The
AXIOM document structure is queried to retrieve the AXIOM nodes.
The NonStop SOAP 4 APIs provide the following functions to process the AXIOM document structure:
“The axiom_document_create()Function (page 94)
“The axiom_document_build_all()Function (page 94)
“The axiom_document_free()Function (page 95)
The axiom_document_create()Function
The axiom_document_create()function creates an axiom_document_t structure. This
structure holds the AXIOM node representation of the input XML payload.
Synopsis:
AXIS2_EXTERN axiom_document_t* axiom_document_create
( const axutil_env_t * env,
axiom_node_t * root,
struct axiom_stax_builder * builder )
Parameters:
env
is an input parameter and is a pointer to the environment structure. It cannot have a NULL
value.
root
is an input parameter and is a pointer to the root node of the XML document.
builder
is an input parameter and is a pointer to the StAX parser.
Return Value:
Pointer to the newly created AXIOM document. If an error occurs, it returns NULL.
The axiom_document_build_all()Function
The axiom_document_build_all()function builds the XML input stream from the current
position of the StAX parser till the root element is complete.
Synopsis:
AXIS2_EXTERN axiom_node_t* axiom_document_build_all
( struct axiom_document * document,
const axutil_env_t * env )
Parameters:
document
is an input parameter and is a pointer to the axiom_document_t structure to be built.
env
is an input parameter and is a pointer to the environment structure. It cannot have a NULL
value.
94 NonStop SOAP 4 Service APIs