|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (28)
View Page History{section}
{column}
{column}
h1. Preliminary notes
There is no difference.
{warning}
Just be careful to provide a default value to the outputLocation context variable.
{warning}
Just be careful to provide a default value to the outputLocation context variable.
{warning}
h2. Exporting the job
Select the job and right-click it. Select *Export to Petals ESB*. Job Scripts*.
Update the target destination.
In the *Export type* combo, select *Petals ESB*.
Let Update the target destination and let the job be exposed as a singleton.
Click *Edit the exposed contexts*.
You should have the following dialog:
!SimpleJobExportOutAttachment.jpg! !PetalsContextOut.jpg!
Click the *Export mode* column, and select *Parameter* in the combo box. Click *OK*.
The link label should be updated and indicate the number of exported contexts.
The link label should be updated and indicate the number of exported contexts.
!SimpleJobExportContext2.jpg! !PetalsContextAsParameter_2.jpg!
Click *Finish*.
h2. Deploying and testing this new service
To test this service, you can use a tool like SoapUI.
This way, you can see what the XML messages look like.
This way, you can see what the XML messages look like.
Since we use attachments, we will prefer using a Java client instead of SoapUI.
However, it is possible to use SoapUI to send or receive messages with attachments. Just make sure the MTOM property is activated.
However, it is possible to use SoapUI to send or receive messages with attachments. Just make sure the MTOM property is activated.
The first thing to do is to create a service-unit for the Petals-BC-SOAP component, that exposes (consumes) our _Talend job as a service_ outside the bus.
This step is not described here. You can take a look at the Petals-BC-SOAP documentation and the Petals Studio documentation.
Just make sure the SOAP configuration uses the InOut MEP.
Just make sure the SOAP configuration uses the InOut MEP.
Then, to generate a client from the WSDL, you can use Apache CXF or Axis2.
As an example, the following code was generated with Apache CXF 2.2.6.
Check the CXF documentation to see how to develop a service consumer in Java.
Only the main client class is shown here.
As an example, the following code was generated with Apache CXF 2.2.6.
Check the CXF documentation to see how to develop a service consumer in Java.
Only the main client class is shown here.
\\
Now, your input message (in SoapUI) should look like this:
The client's code is the following:
{code:lang=xml} {code:lang=java}
TODO
{code}
\\
{code}
\\
Notice that there are only empty parameters.
Notice that the MTOM-mode was activated. Not enabling it will result in errors.
\\
The returned message, when everything works, is:
The execution output is:
{code:lang=xml} {code:lang=java}
TODO
{code}
{code}
\\
If the job execution fails, the 0 is replaced by another integer, e.g. 1.
One failure reason can be, as an example, that the database is not started.
One failure reason can be, as an example, that the database is not started.
\\
Here are the first lines in this file (the database was populated with random values from another Talend job - do not be shocked by the values).
Here are the first lines in this file (the database was populated with random values from another Talend job - do not be shocked by the values).
To determine the act cause of a problem, you would have to use logging features available in the Talend palet.
However, let's make it clear, the job's logs are managed independently of Petals and its monitoring capabilities.
However, let's make it clear, the job's logs are managed independently of Petals and its monitoring capabilities.
{noformat}
TODO: detail the output attachment
{noformat}
{column}
{column:width=350px}
{column:width=350px}