Using JAXM within JSP Pages
This release of JAXM has some custom JSP tags that can be used to create,
send, receive, and process JAXM messages. This document briefly describes
the tags and their behavior.
jaxm:context
Initializes JAXM and sets up generic scripting variables you can use in
your page:
-
javax.xml.soap.SOAPConnection jaxmConnection
-
javax.xml.soap.MessageFactory jaxmMessageFactory
It also initializes a variable, jaxmPageURI with the constructed
URI of this web application.
jaxm:onMessage
Receives a message and returns a response. If the request is not a JAXM
POST, the body is ignored and processing continues with what's after this
tag. Inside the tag, you can either use scriptlet to construct a response
in java or you can just write the response as "plain" XML.
Attributes:
-
msgId: used to create the scripting variable that will hold the
incoming message
-
resId: used to create the scripting variable that will hold the
response message
-
useBody: true (default) if you'll use the tag body as a response,
false if you'll use scriptlet.
The following variables are set:
-
javax.xml.soap.SOAPMessage [replyId],[msgId]
-
javax.xml.soap.SOAPBody [msgId]Body
-
javax.xml.soap.SOAPHeader [msgId]Header
jaxm:call
Do a jaxm call, using the tag body as a message.
Attributes:
-
msgId: the name of the scripting variable holding the message
to be sent
-
resId: the name of the scripting variable that will hold the response
-
endpoint: the URL where the message will be sent.
Scripting variables:
-
javax.xml.soap.SOAPMessage [resId]: the reponse (set after the
tag is executed)
jaxm:soapBody
Encapsulates the content of the message to be sent in <jaxm:call> and
the response of <jaxm:onMessage>.
jaxm:dump
Displays a jaxm message.
Attributes:
-
msgId: the name of the page attribute holding the message to be
displayed.