\\
And here are the properties of the tPetalsInput component.
!PetalsToJob_tpi_msoproperties_2.jpg!
h2. Exporting the job
Select the job and right-click it. Select *Export to Petals ESB*.
Update the target destination.
Let the job be exposed as a singleton.
You should have the following dialog:
!PetalsToJob_tpi_export.jpg!
Click *Finish*.
h1. Deploying and testing in Petals
h2. Looking at the generated WSDL
In the created Petals service assembly, the most interesting thing to look at is the WSDL.
Indeed, the WSDL will determine the way the exported service will be called.
\\
The input message's description only expects the data for the tPetalsInput component.
The WSDL generation has taken into account the schema of the tPetalsInput.
{code:lang=xml}
<xs:element name="executeJob" type="tns:executeJob" />
<xs:complexType name="executeJob">
<xs:sequence>
<xs:element minOccurs="0" name="contexts" type="tns:talendContexts" />
<xs:element minOccurs="0" name="in-attachments" type="tns:inAttachments" />
<xs:element maxOccurs="unbounded" minOccurs="0" name="in-data-bean" type="tns:inRow" />
<xs:element maxOccurs="unbounded" minOccurs="0" name="talend-option" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="talendContexts">
<xs:sequence>
</xs:sequence>
</xs:complexType>
<xs:complexType name="inAttachments">
<xs:sequence>
</xs:sequence>
</xs:complexType>
<xs:complexType name="inRow">
<xs:sequence>
<xs:element name="id" type="xs:integer" /> <xs:element name="name" type="xs:string" />
<xs:element name="address" type="xs:string" nillable="true" />
<xs:element name="registerTime" type="xs:long" nillable="true" />
</xs:sequence>
</xs:complexType>
{code}
\\
{tip}
Notice that the Java *Date* type is expected to be given as a *timestamp* (long). The date pattern is defined and applied in the job.
{tip}
\\
And the output message only includes the job's result.
{code:lang=xml}
<xs:element name="executeJobResponse" type="tns:executeJobResponse" />
<xs:complexType name="executeJobResponse">
<xs:sequence>
<xs:element minOccurs="0" name="talend-job-output" type="tns:talendJobOutput" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="talendJobOutput">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="executionResult" nillable="true" type="ns1:stringArray" />
<xs:element minOccurs="0" name="outAttachment" type="tns:outAttachments" />
<xs:element maxOccurs="unbounded" minOccurs="0" name="outDataBean" nillable="true" type="tns:outRow" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="outAttachments">
<xs:sequence>
</xs:sequence>
</xs:complexType>
<xs:complexType name="outRow">
<xs:sequence>
</xs:sequence>
</xs:complexType>
{code}
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.
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.
\\
Now, your input message (in SoapUI) should look like this: