Creating a proxy to run a stored procedure

muckypup's picture
I'm trying to create a proxy that calls a stored procedure (Database lookup mediator) and returns a numbers of rows of data. I can seem to set it up ok. I create a sequence with a database lookup mediator in it. I can specify the db connection strings ok and set up to return a single column of data (one result column). I have added this to my proxy service as an outgoing anonymous message (Do i need a send mediator as well?). The first problem comes when I select a publishing WSDL. I select pick from registry and then select my sequence from the local registry. When I try and save I get the error "Unable to save proxy service. Invalid definition :: Couldn't build the proxy service : DatabaseLookup. Unable to locate the specified WSDL to build the service" How do I get wso2 to generate a WSDL for my database query? Steve
ruwan's picture

Hi Steve, When you do the

Hi Steve, When you do the DBLookup it just enriches the message with the data from the database, but it doesn't send the message out. So you need to use the send mediator after the DBLookup to send the message out. publishWSDL requires a WSDL to be fed to create the proxy service, but you are specifying a sequence. Using the WSO2 ESB you cannot generate a WSDL for the query. WSO2 has a product called DataServices [1] which lets you do this though. Please generate the WSDL using the DS solution and attach that as the WSDL to be published. [1] http://wso2.org/projects/solutions/data-services/java Thanks, Ruwan Linton
muckypup's picture

Hi, I will try and install

Hi, I will try and install wso2 data service alongside esb. Are you saying that the ESB should contact the data services to access the database, or that I should just use data services to generate the WSDL and add this to the esb? Steve
ruwan's picture

You could do both, Either

You could do both, Either you can just generate the WSDL using the DS solution and create a proxy in ESB to use the DB mediators, or alternatively, you could use the DS solution. Please have a look at the DS solution and you will be able to get the decision by your own by assessing your requirement. Thanks, Ruwan Linton
library project main code
Learn Cloud
Learn
Cloud

The WSO2 Application Server is a reliable application server that can host your enterprise web applications. The WSO2 Application Server as a Service is offered in StratosLive, the WSO2 Platform as a Service. This article explains how a simple web application can be developed and deployed from Carbon Studio to the WSO2 Application Server...

Latest Webinar
Different groups within an organization need to monitor different Key Performance Indicators (KPIs) - An operations team will be interested in the response times of business services and loads of each service,..
Thursday, February 9th 2012, 09.00 AM (PST)

Thursday, February 9th 2012, 10.00 AM (GMT)