• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » How to read from a webservice ?

#1 2008-01-22 15:20:58

Toni_Fatec
Member
Company: Lampada Global Services
Registered: 2008-01-03
Posts: 16
Website

How to read from a webservice ?

How to read informations from a Web Service?

I have a service located like: http://192.168.0.200:8080/system/servic … ation?wsdl
Where in Talend is the component used to map this kind of thing?

Thanks in advance

Offline

#2 2008-01-22 16:01:32

plegall
Member
Registered: 2006-09-19
Posts: 1586
Website

Re: How to read from a webservice ?

I can't read your WSDL but tWebServiceInput is the right component to read a web service and transform it into a data flow.

Offline

#3 2008-01-22 20:47:05

Toni_Fatec
Member
Company: Lampada Global Services
Registered: 2008-01-03
Posts: 16
Website

Re: How to read from a webservice ?

Hi plegall, that service is in my LAN. In simple words it receive a int and returns an Array of a complex type. Take a deeper look:

<wsdl:definitions targetNamespace="http://192.168.0.200:8080/openbravo/services/sugarCRMIntegration">

    <!--
WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)
-->

    <wsdl:types>

    <schema targetNamespace="http://192.168.0.200:8080/openbravo/services/sugarCRMIntegration">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>

    <complexType name="BPartner">

    <sequence>
<element name="address1" nillable="true" type="xsd:string"/>
<element name="address2" nillable="true" type="xsd:string"/>
<element name="cBpGroupName" nillable="true" type="xsd:string"/>
<element name="city" nillable="true" type="xsd:string"/>
<element name="id" nillable="true" type="xsd:string"/>
<element name="name" nillable="true" type="xsd:string"/>
<element name="phone" nillable="true" type="xsd:string"/>
<element name="taxId" nillable="true" type="xsd:string"/>
</sequence>
</complexType>

    <complexType name="ArrayOfBPartner">

    <complexContent>

    <restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="impl:BPartner[]"/>
</restriction>
</complexContent>
</complexType>
</schema>
</wsdl:types>

    <wsdl:message name="getBusinessPartnerNameResponse">
<wsdl:part name="getBusinessPartnerNameReturn" type="impl:ArrayOfBPartner"/>
</wsdl:message>

    <wsdl:message name="getBusinessPartnerNameRequest">
<wsdl:part name="in0" type="xsd:int"/>
</wsdl:message>

    <wsdl:portType name="sugarCRMIntegrationImpl">

    <wsdl:operation name="getBusinessPartnerName" parameterOrder="in0">
<wsdl:input message="impl:getBusinessPartnerNameRequest" name="getBusinessPartnerNameRequest"/>
<wsdl:output message="impl:getBusinessPartnerNameResponse" name="getBusinessPartnerNameResponse"/>
</wsdl:operation>
</wsdl:portType>

    <wsdl:binding name="sugarCRMIntegrationSoapBinding" type="impl:sugarCRMIntegrationImpl">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>

    <wsdl:operation name="getBusinessPartnerName">
<wsdlsoap:operation soapAction=""/>

    <wsdl:input name="getBusinessPartnerNameRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://sugarCRMIntegration.ws.erpCommon.openbravo.org" use="encoded"/>
</wsdl:input>

    <wsdl:output name="getBusinessPartnerNameResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://192.168.0.200:8080/openbravo/services/sugarCRMIntegration" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>

    <wsdl:service name="sugarCRMIntegrationImplService">

    <wsdl:port binding="impl:sugarCRMIntegrationSoapBinding" name="sugarCRMIntegration">
<wsdlsoap:address location="http://192.168.0.200:8080/openbravo/services/sugarCRMIntegration"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

Offline

#4 2008-01-23 03:44:25

shong
Talend team
Registered: 2007-08-29
Posts: 10289
Website

Re: How to read from a webservice ?

Hi Toni_Fatec

About the usage and some limitation of  tWebServiceInput  component, please read the related [Forum, topic 1991] Web services output.

Best regards

         shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#5 2008-01-23 09:39:47

plegall
Member
Registered: 2006-09-19
Posts: 1586
Website

Re: How to read from a webservice ?

I've tried to retrieve an array of complexTypes with a Perl job. It works.

Using the same configuration of tWebServiceInput in a Java job, it fails. I advise you to report a bug notification in the bugtracker.


Uploaded Images

Offline

#6 2008-01-23 16:44:53

Toni_Fatec
Member
Company: Lampada Global Services
Registered: 2008-01-03
Posts: 16
Website

Re: How to read from a webservice ?

Hi plegall. I tried the same test you did. It returns a similar error of my test with my Web Service with complex type.

I saw in your WSDL that the method getUserList returns an Array of Users, and each User has 2 String and 1 int in it, so it is a complex type too. How could I create a Perl Job ? Do I need to know Perl language in order to use my WebService ?


Uploaded Images

Offline

#7 2008-01-23 17:41:34

plegall
Member
Registered: 2006-09-19
Posts: 1586
Website

Re: How to read from a webservice ?

Toni_Fatec wrote:

I saw in your WSDL that the method getUserList returns an Array of Users, and each User has 2 String and 1 int in it, so it is a complex type too.

Yes, it's an array of complex types. You can use it, it's provided as a test webservice for TOS users. http://talendforge.org/test/ws/soap_server.php?wsdl

Toni_Fatec wrote:

How could I create a Perl Job ? Do I need to know Perl language in order to use my WebService ?

You have to create a new project (generated language is related to the project) and choose Perl language.

Offline

#8 2008-01-23 17:43:04

Toni_Fatec
Member
Company: Lampada Global Services
Registered: 2008-01-03
Posts: 16
Website

Re: How to read from a webservice ?

Trying to create a Perl project.
When I press the button "Run" the console of Talend returns errors:

Starting job getTalendService at 14:38 23/01/2008.
Can't locate SOAP/Lite.pm in @INC (@INC contains: /root/workspace/.Perl /home/root/Talend Open Studio 2.2.3/lib/perl /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /root/workspace/.Perl/WEBSERVICES.job_getTalendService.pl line 234.
BEGIN failed--compilation aborted at /root/workspace/.Perl/WEBSERVICES.job_getTalendService.pl line 234.
Job getTalendService ended at 14:38 23/01/2008. [exit code=2]


any idea in how to fix it?

Offline

#9 2008-01-23 21:01:30

Toni_Fatec
Member
Company: Lampada Global Services
Registered: 2008-01-03
Posts: 16
Website

Re: How to read from a webservice ?

shong wrote:

Hi Toni_Fatec

About the usage and some limitation of  tWebServiceInput  component, please read the related [Forum, topic 1991] Web services output.

I read that, and you say "tWebServiceInput doesnn't support complex types." . So, how is it possible to receive the TOS webservice that returns an array of complex Type with a Perl Job like plegall did? Is it a Java job limitation only or a bug or something else?

Offline

#10 2008-01-23 22:33:16

plegall
Member
Registered: 2006-09-19
Posts: 1586
Website

Re: How to read from a webservice ?

Toni_Fatec wrote:

Can't locate SOAP/Lite.pm in @INC

This is not a bug :-) The Perl interpreter tells you it can't find the SOAP::Lite module. If you are using ActivePerl, install the module with PPM (Perl Package Manager). More information on [wiki] Perl on Windows for Talend Open Studio.

Offline

#11 2008-01-23 22:35:45

plegall
Member
Registered: 2006-09-19
Posts: 1586
Website

Re: How to read from a webservice ?

Toni_Fatec wrote:

So, how is it possible to receive the TOS webservice that returns an array of complex Type with a Perl Job like plegall did? Is it a Java job limitation only or a bug or something else?

I've discussed today with mhirt who is in charge of Java components. He should come in this topic as soon as possible. Currently (TOS 2.3.0RC2), Java tWebService can't read such an answer from a webservice.

Offline

#12 2008-01-24 13:06:33

Toni_Fatec
Member
Company: Lampada Global Services
Registered: 2008-01-03
Posts: 16
Website

Re: How to read from a webservice ?

plegall wrote:

This is not a bug :-) The Perl interpreter tells you it can't find the SOAP::Lite module. If you are using ActivePerl, install the module with PPM (Perl Package Manager). More information on [wiki] Perl on Windows for Talend Open Studio.

I am using Fedora 7, and tested Perl, the result is "This is perl, v5.8.8 built for x86_64-linux-thread-multi". So I guess Perl is installed but with the x86_64 version, which may be causing problems cause' I am using the 32bits version of TOS (the 64bit version crashes here).

I do not know a line of Perl as well, so I wonder if using a Perl Job would be useful to me.

Offline

#13 2008-01-24 13:10:36

plegall
Member
Registered: 2006-09-19
Posts: 1586
Website

Re: How to read from a webservice ?

Toni_Fatec wrote:

I am using Fedora 7, and tested Perl [...]

That's even better. Use cpan to install SOAP::Lite. As root, type "cpan" and in the cpan command line, type "install SOAP::Lite".

Offline

#14 2008-01-24 16:22:32

Toni_Fatec
Member
Company: Lampada Global Services
Registered: 2008-01-03
Posts: 16
Website

Re: How to read from a webservice ?

The Perl Job worked now, thanks plegall.

testing the TOS demo, it is missing some data:

Starting job getTalendService at 13:19 24/01/2008.
||27
||32
||31
Job getTalendService ended at 13:19 24/01/2008. [exit code=0]

Offline

#15 2008-01-24 16:42:35

plegall
Member
Registered: 2006-09-19
Posts: 1586
Website

Re: How to read from a webservice ?

In the schema, be careful with case sensitivity, you have to write "firstname" and "lastname" (small letters).

Offline

#16 2008-01-28 13:53:34

Toni_Fatec
Member
Company: Lampada Global Services
Registered: 2008-01-03
Posts: 16
Website

Re: How to read from a webservice ?

Putting in lower case it returns all data, great.

My own complex type is named BPartner and its fields are id, name, taxId, cBpGroupName, city, address1, address2, phone. Those are the exactly names I must put in my schema. I am saying it for the other users that could have the same doubt I had.

------------------------------------------------------------------------------------------------------------------------------------------------
Now the Service is returning OK but with one character error:
Street n&#xBA; A - should be: Street nº A
Is there a way in which it recognize the ° character ?

ps: the http://www.talendforge.org/test/ws/soap_server.php?wsdl are out of air

Last edited by Toni_Fatec (2008-01-28 14:08:25)

Offline

#17 2009-08-12 00:14:41

FredT
New member
Registered: 2009-08-10
Posts: 6

Re: How to read from a webservice ?

Sorry to wake this topic up, but http://talendforge.org/test/ws/soap_server.php?wsdl is 404 now... Is it still available somewhere else ?

TIA

Fred

Offline

#18 2009-08-27 14:10:41

FredT
New member
Registered: 2009-08-10
Posts: 6

Re: How to read from a webservice ?

please, any news on this ?

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » How to read from a webservice ?

Board footer

Powered by FluxBB