how to generate service and wsdl from job in version 5.0.2?
Hello,
This is most likely a dumb question but can someone point me to a tutorial on how to generate a service from an existing job in TOS for ESB 5.0?
I know I can generate a service from an existing wsdl, and that is great, but I can't find examples of code-first service creation.
I know I can also create a generic service and it will write its own wsdl.
I have tried this route, and created a generic service.
Then I have created a job by clicking on the generic operation in the service and choosing "create job"
Then I've edited the created job and changed the inputs and outputs using tXMLMap component.
But I'm stuck how to proceed from there. How do I make the service wsdl reflect the modified job?
Or is there a much cleaner design route for this?
well I tried a different approach, in that I created a generic service and used the wsdl editor to rename and add elements to both the OperationRequestType and the OperationResponseType. Then I created a new job from this operation.
When I click on the tESBProviderRequest component in the newly created job, the schema editor only shows one column: payload.
When I link that component to a tXMLMap component, the mapping editor only shows payload element with a root child element.
When I run the service, I get this wsdl:
<wsdl:definitions name="Agencies" targetNamespace="http://www.talend.org/service/">
?
<wsdl:types>
?
<xsd:schema targetNamespace="http://www.talend.org/service/">
?
<xsd:element name="AgenciesOperationRequest">
?
<xsd:complexType>
?
<xsd:sequence>
<xsd:element name="agencyID" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
?
<xsd:element name="AgenciesOperationResponse">
?
<xsd:complexType>
?
<xsd:sequence>
<xsd:element name="agencyID" type="xsd:int"/>
<xsd:element name="agencyName" type="xsd:string">
</xsd:element>
<xsd:element name="agencyHost" type="xsd:string">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
?
<wsdl:message name="AgenciesOperationRequest">
<wsdl
art element="tns:AgenciesOperationRequest" name="parameters">
</wsdl
art>
</wsdl:message>
?
<wsdl:message name="AgenciesOperationResponse">
<wsdl
art element="tns:AgenciesOperationResponse" name="parameters">
</wsdl
art>
</wsdl:message>
?
<wsdl
ortType name="AgenciesPortType">
?
<wsdl
peration name="AgenciesOperation">
<wsdl:input message="tns:AgenciesOperationRequest">
</wsdl:input>
<wsdl
utput message="tns:AgenciesOperationResponse">
</wsdl
utput>
</wsdl
peration>
</wsdl
ortType>
?
<wsdl:binding name="AgenciesBinding" type="tns:AgenciesPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
?
<wsdl
peration name="AgenciesOperation">
<soap
peration soapAction="http://www.talend.org/service/AgenciesOperation"/>
?
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
?
<wsdl
utput>
<soap:body use="literal"/>
</wsdl
utput>
</wsdl
peration>
</wsdl:binding>
?
<wsdl:service name="Agencies">
?
<wsdl
ort binding="tns:AgenciesBinding" name="AgenciesPort">
<soap:address location="http://localhost:8090/services/Agencies"/>
</wsdl
ort>
</wsdl:service>
</wsdl:definitions>
My question is:
How do I get to the value of the "agencyID" element in the tXMLMap component???
Good morning.
The payload attribute is a data object that contains an xml structure, accessible via XPATH and XQuery expressions (e.g. via tXMLMapComponent).
As far as I know, you'll have to do 2 steps within the tXMLMap component, if you use the payload attribute:
(1) Try to generate an XML sample of your wsdl operation / request that is assigned to the payload data. Right click on the "payload" attribute an choose "import from xml file" and import the xml structure from the sample. Then you' ll see the tree xml structure under the payload attribute.
(2) Use, transform or associate the input structure from the right with the output structure on the left. For the output structure (if you plan to use an xml type / payload) you can easily import an example xml file as mentioned in step 1
I attached an image due to the fact my explanation shoudn't be as clear as I thought, while writing this 😉 Kind regards
Alexander
Thanks Alexander,
That was very helpful.
I used SoapUI app to generate my sample request and also my sample response xml and then loaded those into tXMLMap component editor.
I also have a mysql table now hooked into tXMLMap as a Lookup.
The lookup seems to always fail though and I get zero results.
basically, the soap request just send and ID of 1:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://www.talend.org/service/">
<soapenv:Header/>
<soapenv:Body>
<ser:AgenciesOperationRequest>
<agencyID>1</agencyID>
</ser:AgenciesOperationRequest>
</soapenv:Body>
</soapenv:Envelope>
tXMLMap gets this value this way:
Integer.parseInt()
(I have to parse the "1" to an int since the DB table is using the INT data type for the field I'm matching on)
Does that seem correct?
I haven't figured out yet how better to monitor where the error is, since the running service shows no errors, but just returns zero results, even though the ID is a match in the DB table.
Tried to upload a screenshot of my editor but its not working. I've reduced the .png to 1000px wide and file size is 147kb but it does not seem to be uploading . . .
OK I have the service doing the minimal lookup from a DB based on an incoming value in the request.
I have to manually create the xml structure in for both incoming and outgoing tables in the tXMPMap component to match how they look in the DemoService.
The structures that were there after importing the sample request and responses from SoapUI did not work. (they can be seen in the screenshot I uploaded above)
Now I'm trying to add a second operation to the service. I've added it in the WSDL using the editor, and saved everything, but in the left panel, I do not see the new operation listed. In the ReservationService there are three operation listed. How do I get the left panel to "refresh" to see the new operation I have added?
Once I get that to happen, I will create a new job for this new operation and go from there . . .
current screenshot.