I want to consume Magento SOAP webservice in Talend. The newbie solution I tried first was to write manually soap messages in custom routines. It works but not viable at long term and really painful to maintain. You guess it's the first time I deal with SOAP.
Now I've discovered code generation using wsdl2java in tWebServiceInput. I got the following new routines: BindingStub, MagentoService, MagentoServiceLocator, Porttype.
In a tJava, I wrote:
String wsdl = "http://mymagento.localhost/index.php/api/soap/"; routines.PortType porttype = new routines.MagentoServiceLocator().getPort(new java.net.URL(wsdl)); String resp= porttype.login("myusername", "mypassword"); System.out.println(resp);
But when I run it, I got the following error.
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/rpc/Service
How do I install this missing class ?
There are two ways for you to import and use an external jar.
1)Using tLibraryload component to load the jar file at the begininig of job. for example:
tJava(on tJava, use the external API)
2)Creating custom routine, import the external jar file by clicking on the routine name and editing the routine libraries, and then call this routine in the job.
Join us at the Community Lounge.
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Watch the recorded webinar!
Learn how to use an API-First Approach to Modernize your Applications
Pick up some tips and tricks with Context Variables
Take a look at this technical overview video of Talend API Designer