call
input contains at least one root
element around <delegation:execute>
elements.
|
|||||||||||||||||
OPS User Guide
|
Delegation Processor
1. IntroductionThe Delegation processor allows calling services implemented as:
The main benefit of the Delegation processor is that you do not need to implement your own XML processor in Java to call services. 2. Inputs and Outputs
3. Calling a JavaBeanThis is an example of using the Delegation processor to call a JavaBean:
<p:processor name="oxf:delegation"> <p:input name="interface"> <config> <service id="my-service" type="javabean" class="MyClass"/> </config> </p:input> <p:input name="call"> <result> <delegation:execute service="my-service" operation="myMethod"> <param1 xsi:type="xs:string">param1</param1> </delegation:execute> </result> </p:input> <p:output name="data" id="result"/> </p:processor>
4. Calling an EJBThis is an example of using the Delegation processor to call an EJB:
<p:processor name="oxf:delegation"> <p:input name="interface"> <config> <service id="creditcard-validation" type="stateless-ejb" uri="java:comp/env/ejb/creditcard-validation"/> </config> </p:input> <p:input name="call"> <delegation:execute service="creditcard-validation" operation="validate"> <number xsi:type="xs:string">1234123412341234</number> <type xsi:type="xs:string">visa</type> </delegation:execute> </p:input> <p:output name="data" id="result"/> </p:processor>
5. Calling a Web Service5.1. Example: RPC-Style
<p:processor name="oxf:delegation"> <p:input name="interface"> <config> <service id="quotes" type="webservice" style="rpc" endpoint="http://www.scdi.org/~avernet/webservice/"> <operation nsuri="urn:avernet" name="getRandomQuote" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </service> </config> </p:input> <p:input name="call"> <delegation:execute service="quotes" operation="getRandomQuote"/> </p:input> <p:output name="data" id="result"/> </p:processor>
5.2. Example: Document-Style
<p:processor name="oxf:delegation"> <p:input name="interface"> <config> <service id="stock-quote" type="webservice" style="document" endpoint="http://ws.cdyne.com/delayedstockquote/delayedstockquote.asmx"> <operation name="get-quote" soap-action="http://ws.cdyne.com/GetQuote"/> </service> </config> </p:input> <p:input name="call"> <delegation:execute service="stock-quote" operation="get-quote" xsl:version="2.0"> <m:GetQuote> <m:StockSymbol> <xsl:value-of select="/symbol"/> </m:StockSymbol> <m:LicenseKey>0</m:LicenseKey> </m:GetQuote> </delegation:execute> </p:input> <p:output name="data" id="result"/> </p:processor>
5.3. Usage
|