Petals-BC-SOAP

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (3)

View Page History
h3. Provide mode : Provide access to external REST Service

todo
In order to activate REST mode, the Service Unit (in provide mode) must be configured like this :

{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<jbi:jbi version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-4.0"
xmlns:soap="http://petals.ow2.org/components/soap/version-3.1"
xmlns:sample="http://petals.ow2.org/soap/sample">

<!-- Import a Service into PEtALS or Expose a PEtALS Service => use a BC. -->
<jbi:services binding-component="true">
<!-- Import a Service into PEtALS => provides a Service. -->
<jbi:provides
interface-name="sample:SoapInterface"
service-name="sample:SoapInterface"
endpoint-name="SoapInterfaceEndpoint">

<!-- CDK specific fields -->
<petalsCDK:mep xsi:nil="true"/>

<!-- WSDL file -->
<petalsCDK:wsdl>
http://example.org/service/SampleWebService?wsdl
</petalsCDK:wsdl>

<!-- SOAP specific fields -->
<soap:address>
http://example.org/param1={xpathexpression1}&amp;param2={xpathexpression1}
</soap:address>
<soap:mode>REST</soap:mode>
<soap:rest-http-method>GET</soap:rest-http-method>
</jbi:provides>
</jbi:services>
</jbi:jbi>
{code}

* The address parameter can be configured with placeholders. In the previous code snippet, the placeholder is the bracket {}. The placeholder will be replaced by the result of the XPath expression defined inside of the placeholder. The XPath expression is performed on the content of the incoming JBI message. The placeholders will be replaced in the adress parameter to build the final URI according to the result of the XPath expression.
* The mode parameter must be set to REST to enable REST feature in component.
* Possible rest-http-method parameter values are GET, POST, PUT, DELETE (default is GET). It will be used in provider mode by Axis2 as HTTP method invokation.
** GET : The JBI message is only used to create the URI of the REST service to be invoked with the placeholders mechanism.
** POST : The JBI message is sent to the REST service.
** PUT : The JBI message is sent to the REST service.

h3. Consume mode : Expose JBI Service as as REST Service