Custom JSP taglib. Lets you execute SOAP over HTTP requests and prepare SOAP messages. Body tag SOAPrequest executes SOAP over HTTP request. You must set target URL and SOAPaction as parameters for this tag. Body for this tag will be interpreted as an envelope for SOAP message. Body tags SOAPmessage, SOAPheaders and SOAPbody help you to prepare SOAP response.
For example (currency exchange service on http://www.xmethods.net):
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<country1 xsi:type="xsd:string">US</country1>
<country2 xsi:type="xsd:string">Russia</country2>
</ns1:getRate>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
</do:SOAPrequest>
SOAP response can be saved also in the page scope variable (type is String)
for the future processing:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<country1 xsi:type="xsd:string">US</country1>
<country2 xsi:type="xsd:string">Russia</country2>
</ns1:getRate>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
</do:SOAPrequest>
Result is:<%=A%>
Tag SOAPmessage helps you to compose messages. For example, the above
mentioned data might looks like so:
<country1 xsi:type="xsd:string">US</country1>
<country2 xsi:type="xsd:string">Russia</country2>
</ns1:getRate>
</do:SOAPmessage>
You may define also header and body for message. For example:
<do:SOAPheaders uri="http://acme.com/headers">
<do:SOAPheader name="header1" mandatory="true">value for header1</do:SOAPheader>
<do:SOAPheader name="header2">value for header2</do:SOAPheader>
</do:SOAPheaders>
<do:SOAPbody>
<country1 xsi:type="xsd:string">US</country1>
<country2 xsi:type="xsd:string">Russia</country2>
</ns1:getRate>
</do:SOAPbody>
</do:SOAPmessage>
Tags are:
SOAPrequest
Executes SOAP over HTTP request. Parameters are:
1) url target URL.
2) action describes SOAP action.
3) method describes SOAP method
4) id Optional parameter, describes
page scope String variable. Without this variable result of request
will be printed, otherwise it will be saved in this variable.
5) asynch Execution mode. Possible values are true or false.
Default value is false. If you set this value to true SOAP request
will be executed in the separate thread.
SOAPmessage
Body tag. Wraps own body into envelope stuff. Parameters are: none
SOAPheaders
Body tag. Interprets own body as a header section for SOAP message. You may use this tag within SOAPmessage. Parameters are:
1) uri URI for namespace
SOAPheader
Body tag. Interprets own body as an individual header for SOAP message. You may use this tag within SOAPheaders. Parameters are:
1) name name for header
2) mandatory Optional parameter with
possible values true or false. Describes header's status
(mustUnderstand attribute).
SOAPbody
Body tag. Interprets own body as a body for SOAP message. You may
use this tag within SOAPmessage. Parameters are: none
for downloading:
Library: soaptag.jar Description: taglib.tld
© Coldbeans Software Comments?
See also Coldtags suite - the largest collection of custom JSP tags.