One Star

[resolved] How to create webservice that calling to second webservice

Hi, I have a problem to create my own web service. I'm trying do a simple thing on weather web service example from site: http://www.deeptraining.com/webservices/weather.asmx

I want to create and deploy webservice who will be giving me a response from another external webservice. I'm using weather WSDL and create service, next step will be to create definition of this service in job. How this definition should look ??
T_esb_provider_request (xml request) ----> ????? ( between this I need to communicate with external service that will get input and give output) -----> T_esb_provider_response ( xml response)
Can someone help me to resolve this problem ??
Many Thanks
Lukasz
1 ACCEPTED SOLUTION

Accepted Solutions
Community Manager

Re: [resolved] How to create webservice that calling to second webservice

Hi lukasz.noga
The basis use of twebserviceInput do not support the complex type as input parameter such as an instance of a class in your case, you need to use the WSDL2Java feature in the advanecd setting panel of twebserviceInput. You can refer to a demo case in this topic:
http://www.talendforge.org/forum/viewtopic.php?id=6226
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
5 REPLIES
Community Manager

Re: [resolved] How to create webservice that calling to second webservice

Hi
In Talend, you can use a tWebservice, tWebserviceInput or tSOAP to call a Soap web service, let's assuming you want to call the weather web service for example, the job design looks like:
tESBProviderRequest--main--tFlowToIterate--tFixedFlowInput--main--tWebService--main--tXMLMap--tESBProviderResponse
on tFixedFlowInput, define the input data for used later as the request parameter on twebservice
on tXMLMap, map the response data of twebservice to a Document for tESBProviderResponse
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] How to create webservice that calling to second webservice

Many thanks Shong for help, I created my first web service and everything is working fine, to update this topic I attach a screen shoot of my service job.

http://www.fotosik.pl/pokaz_obrazek/441962724aead67d.html
One Star

Re: [resolved] How to create webservice that calling to second webservice

Shong to continue a topic can you tell me how to prepare connection using Twebserviceinput for complicated wsdl schema ?? I have something like this :
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="GetItemStockPrice"
targetNamespace="http://getItemStockPrice"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns2="http://getItemStockPrice" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://getItemStockPrice">
<xsd:element name="GetItemStockPriceOperation" type="tns2:GetItemStockPrice">
</xsd:element>
<xsd:element name="GetItemStockPriceOperationResponse"
type="tns2:GetItemStockPriceResponse">
</xsd:element>
<xsd:complexType name="pGetItemStockPrice">
<xsd:sequence>
<xsd:element name="Items" type="tns2:ItemsRequest"
maxOccurs="1"></xsd:element>
<xsd:element name="CustomerID" type="xsd:int"></xsd:element>
<xsd:element name="SalesOrg" type="xsd:string"></xsd:element>
<xsd:element name="requestOrderDetails" minOccurs="0"
maxOccurs="1">
<xsd:simpleType>
<xsd:restriction base="xsd:int">
<xsd:minExclusive value="0"></xsd:minExclusive>
<xsd:maxExclusive value="1"></xsd:maxExclusive>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="GetItemStockPriceResponse">
<xsd:sequence>
<xsd:element name="Header" type="tns2:Header"></xsd:element>
<xsd:element name="Items" type="tns2:ItemsResponse">
</xsd:element>
<xsd:element name="OrderDetails" type="tns2Smiley SurprisedrderDetails"
maxOccurs="1" minOccurs="0"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ItemsRequest">
<xsd:sequence>
<xsd:element name="item" type="tns2:ItemRequest"
minOccurs="1" maxOccurs="unbounded"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ItemRequest">
<xsd:sequence>
<xsd:element name="LocalID" type="xsd:string"
maxOccurs="1" minOccurs="1">
</xsd:element>
<xsd:element name="Quantity" type="xsd:int" minOccurs="0"
maxOccurs="1" nillable="false">
</xsd:element>
<xsd:element name="BasicUnit" type="xsd:string"
minOccurs="0" nillable="false"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Header">
<xsd:sequence>
<xsd:element name="Code" type="xsd:int"></xsd:element>
<xsd:element name="Message" type="xsd:string"></xsd:element>
</xsd:sequence>
</xsd:complexType>

As you see In request I'm asking for 4 arguments but ITEMS argument is a type="tns2:ItemsRequest" so it's class of arguments. How to call that kind of class and use parameters to propagate values??
Many thanks
Community Manager

Re: [resolved] How to create webservice that calling to second webservice

Hi lukasz.noga
The basis use of twebserviceInput do not support the complex type as input parameter such as an instance of a class in your case, you need to use the WSDL2Java feature in the advanecd setting panel of twebserviceInput. You can refer to a demo case in this topic:
http://www.talendforge.org/forum/viewtopic.php?id=6226
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] How to create webservice that calling to second webservice

Thanks Shong for your advise Smiley Happy I resolve a problem.