How to filter and route Webservice operations request

One Star

How to filter and route Webservice operations request

Hello.
What is the best practice for handling a service with several operations?
The scenario is like that:
- I have a tESBProviderRequest that to points a certain WSDL
- I want to route each request (WSDL operation) received by this component to a different data flow or job
This is supposed to be the usual case for webservices, but I can't seem to find an easy way to do it
Thanks in advance for your help,
Employee

Re: How to filter and route Webservice operations request

Hi,
If you are using Talend ESB 5.0.X then you could create a different jobs/data flows for different service operations. That would mean that you will have multiple jobs with multiple tESBProviderRequest components which belong to different operations of the same service.
Would it be enough for your use-case?
Otherwise you could use Talend Route Builder to build a route for content-based routing, see ESB samples with Talend Open Studio for ESB 5.0.1.
Renat
One Star

Re: How to filter and route Webservice operations request

Hello Renat,
Thanks for your answer.
I am using Talend ESB 5.0.0.
Concerning the solution that you provided, is it possible to start the different jobs with the different tESBProviderRequest on the same service port?
I have another question concerning the configuration of the tESBProviderRequest component: I am setting the service port and operation name in the Basic Settings (the property type being Repository). Isn't this tESBProviderRequest supposed to block all requests except for the one corresponding to the chosen operation? This is not the case for my job.
Last can you please send me the link to the routing samples.
Thanks a lot in advance.
Employee

Re: How to filter and route Webservice operations request

Hi,
Yes, it is possible to start different jobs with different tESBProviderRequest on the same service port, but not on the same operation.
Concerning configuration once you have a service entry you could just assign a particular jobs to each service operation. One job per operation. Every service operation will pass data to a particular job, so each operation will be served and no requests will be blocked. Is it your intended design?
Route samples you can find in ESB Sample project in 5.0.1 or here I zipped them for you: http://dl.dropbox.com/u/218306/routes.zip
Renat
One Star

Re: How to filter and route Webservice operations request

Hi,
Yes this is my intended design but i'm not able to implement this. This is not working.
You can find below all my implementation step:
- Create a service from a WSDL file with 2 different operations (a Login and GetFolderItems)
- I created a job1 using the Login operation (right-click create Job)
- In the Job1 i put a tLogRow beetween my EsbProviderRequest and my EsbProvider Response, the EsbProviderRequest the property is set to Repostitory with the Login operation, the EsbProviderResponse is set to Built-in

- I created a job2 using the GetFoldersItems operation (right-click create Job)
- In the Job2 i put a tLogRow beetween my EsbProviderRequest and my EsbProvider Response, the EsbProviderRequest the property is set to Repostitory with the GetFolderItems operation, the EsbProviderResponse is set to Built-in.
- I launch the two jobs (Job1 then Job2) from the Execution tab of the job, the WSDL is succesfully published under localhost:8082. Is this the correct way to launch the jobs?
- I use SoapUI to send some request.
- I send a Login Request using SoapUI, The Job1 LogRow print the request, the Job2 LogRow does nothing.
- I send a GetFolderItems request, the Job1 LogRow print the request, Job2 does nothing.
Here is my problem the job2 is supposed to handle the GetFoldersItems request, why is the Job1 receiving this request ?
Do i miss a step during the service/jobs configurations ? or do i misunderstand the usage of the tEsbProviderRequest component ?
Thanks a lot in advance.
Employee

Re: How to filter and route Webservice operations request

Hi,
Now, I've got your issue. The main problem is simple and complex at the same time: right now we do not support running whole service (with multiple operations) in Talend Studio. Right now you can test your service operations individually by starting them one after another. If you want to test all of the service operations you need to deploy your service into Talend ESB Runtime.
Reason behind that limitation is that default job runtime is standalone JRE, where Talend ESB Runtime is OSGi-based. Current version still uses individual JREs for running jobs and do not deliver embedded OSGi runtime. We are working on improving that in future.
To run Data Service in Talend Runtime do right-click on the service and select 'Export Service', resulting set of OSGi bundles (KAR) file you need to drop into TALEND_ESB_HOME/container/deploy directory. After that you will see your service endpoint listed in http://localhost:8040/services
Renat