|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (28)
View Page History{section}
h2. Dynamic Exposition
h2. Native service
The component can expose directly a generic SendMail service without deploying a service unit.
The component can expose directly a generic service without deploying a service unit to send mails.
To allow the component to provide this generic service, the component must have the WSDL named '{{component.wsdl}}'. To deactivate the generic service supplied by the component, simply remove the file '{{component.wsdl}}' from the component archive.
To allow the component to provide his generic service, the component must have a wsdl with the name: component.wsdl. An example of this file is present in the component.To deactivate the generic service supplies by the component,simply erase the file: component.wsdl.
This service offer two modes:
* *In-payload mode*: The service allows the consumer to send a specific XML message to the component with-all the information needed in the payload to send an email.
* *In-payload mode*: The service allows the consumer to send a specific XML message to the component with-all the information needed in the payload to send an email.
This service offer two mode:
* In-Payload mode: The service allows the consumer to send a specific XML message to the component withall the information needed to send an email in the payload.
* In-Payload mode: The service allows the consumer to send a specific XML message to the component withall the information needed to send an email in the payload.
The IN message looks like :
{code:lang=xml}
<ns0:mail xmlns:ns0="http://petals.ow2.org/components/mail/version-3.0">
<ns0:mail xmlns:ns0="http://petals.ow2.org/components/mail/version-3.0">
{code}
* Out-Payload mode: *WS-Addressing mode*: The service allows the consumer to send a JBI message to the component by setting ws-addressing WS-Addressing properties in the IN message with all the information needed to send an email. The content of the mail (body) is in the payload of the message.
The IN message looks like:
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<mail><body>My Mail Content</body></mail>
<mail xmlns="http://petals.ow2.org/components/mail/version-3.0">
<body>My Mail Content</body>
</mail>
<body>My Mail Content</body>
</mail>
{code}
{table-plus}
h2. Static exposition
h2. Integration service
Petals Mail binding component can be configured by deploying a new service unit to it. The jbi descriptor ( jbi.xml file) of this service unit must contain a provides node describing the link between an internal jbi endpoint and an external email address.
Petals BC Mail can be configured to provide an *integration service provider* deploying a service unit. A part of the service contract of this integration service provider is commanded by Petals BC Mail:
* abstract part (port-type and messages) of the WSDL is completely commanded by Petals BC Mail,
* you can choose your own names for the concrete part (binding and service).
* abstract part (port-type and messages) of the WSDL is completely commanded by Petals BC Mail,
* you can choose your own names for the concrete part (binding and service).
Once a provides node is configured, you can start to send email via the mail binding component. You just have to send message exchange to endpoints activated by service unit deployments (containing jbi.xml with provides node).
The IN message looks like:
The IN message looks like:
Once the service unit is deployed, you just have to send message exchange with an IN message as following to send an email:
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<mail><body>My Mail Content</body></mail>
<mail xmlns="http://petals.ow2.org/components/mail/version-3.0">
<body>My Mail Content</body>
</mail>
<body>My Mail Content</body>
</mail>
{code}
h3. Configuration
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!-- JBI descriptor for PEtALS' "petals-bc-mail" (Mail), version 3.0 -->
<jbi:jbi version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:generatedNs="http://test">
<!-- 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="generatedNs:SendMail"
interface-name="generatedNs:SendMail"
{code}
{include:0 CDK SU Provide Configuration}
\\
{center}{*}Configuration of a Service Unit to provide a service (Mail)*{center}
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}
|| Parameter || Description || Default || Required ||
| scheme | the connection protocol (smtp) | \- | Yes |
| scheme | the connection protocol (smtp) | \- | Yes |
{noformat}
?
h2. Usage