I want to pass my query to database for retrieving the column. I am passing dynamic columns using ESB my configuration is like this
<proxy xmlns="http://ws.apache.org/ns/synapse" name="dbl3" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target>
<inSequence>
<property name="A" value="select e_name,e_address from emp where " scope="default" type="STRING"/>
<property name="B" expression="//fieldname/text()" scope="default" type="STRING"/>
<property name="C" expression="//fieldvalue/text()" scope="default" type="STRING"/>
<property name="D" value="=" scope="default" type="STRING"/>
<property name="E" expression="concat(get-property('A'),get-property('B'),get-property('D'),get-property('C'))" scope="default" type="STRING"/>
<dblookup>
<connection>
<pool>
<password>Youtility11</password>
<user>youtilitydba</user>
<url>jdbc:postgresql://localhost:5432/sample</url>
<driver>org.postgresql.Driver</driver>
</pool>
</connection>
<statement>
<sql>get-property('E')</sql>
<result name="ee" column="e_name"/>
</statement>
</dblookup>
<log level="custom">
<property name="AA" expression="get-property('A')"/>
<property name="BB" expression="get-property('B')"/>
<property name="CC" expression="get-property('C')"/>
<property name="DD" expression="get-property('ee')"/>
<property name="EE" expression="get-property('E')"/>
</log>
</inSequence>
<outSequence>
<send/>
</outSequence> </target> <description></description> </proxy>
My output like this:
EE = select e_name,e_address from emp where e_address=thane
EE = select e_name,e_address from emp where e_no=5
Based on input values query will generate, how can I pass the above query to the database?
My error is like this:
[2013-01-24 14:22:32,743] ERROR - DBLookupMediator Error executing statement : get-property('E') against DataSource : jdbc:postgresql://localhost:5432/sample
org.postgresql.util.PSQLException: ERROR: syntax error at or near "get"
Position: 1
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:273)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.apache.synapse.mediators.db.DBLookupMediator.processStatement(DBLookupMediator.java:46)
at org.apache.synapse.mediators.db.AbstractDBMediator.mediate(AbstractDBMediator.java:143)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:154)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:144)
at org.apache.axis2.transport.http.util.RESTUtil.processXMLRequest(RESTUtil.java:89)
at org.apache.synapse.transport.nhttp.util.RESTUtil.processPOSTRequest(RESTUtil.java:189)
at org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMethod(ServerWorker.java:411)
at org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:268)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)
I'm afraid you can't pass a SQL statement to the "<sql/>" element of the DBLookup/DBReport mediators using "get-property" construct. Besides, I believe what you're trying to do is sort of a hack to pass variables to a SQL query. The proper way of doing this should be by using WSO2 Data Services Server. Please refer the documentation of WSO2 DSS [1] which provides you with a comprehensive guide on how to use it to achieve your data manipulative tasks with its rich set of features offered to the users.
[1] http://docs.wso2.org/wiki/display/DSS301/WSO2+Data+Services+Server+Documentation
Related
I have a REST API on Enterprise Integrator that uses a db lookup mediator to search a microsoft sql server database and redirects based on the whether or not the data exists in the db. I need to make the redirect part of the code configurable/dynamic as it wouldn't make sense to constantly update the url and redeploy every time the url changes.
<api xmlns="http://ws.apache.org/ns/synapse" name="DBLookupAPI" context="/dblookup">
<resource methods="GET" uri-template="/{UserCode}">
<inSequence>
<log level="custom">
<property name="Value" expression="get-property('uri.var.UserCode')"/>
</log>
<dblookup>
<connection>
<pool>
<driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver>
<url>jdbc:sqlserver://10.1.1.111\test;databaseName=UserDB</url>
<user>admin</user>
<password>admin</password>
</pool>
</connection>
<statement>
<sql>select UserCode from UserDB.dbo.Users where UserCode =?;</sql>
<parameter expression="get-property('uri.var.UserCode ')" type="CHAR"/>
<result name="foundnr" column="UserCode "/>
</statement>
</dblookup>
<log level="custom">
<property name="Value" expression="get-property('foundnr')"/>
</log>
<filter source="boolean(get-property('foundnr'))" regex="true">
<then>
<log>
<property name="Message" value="Name Exists Lets redirect"/>
</log>
<property name="HTTP_SC" value="302"/>
<property name="Location" value="https://wso2.com/" scope="transport"/>
</then>
<else>
<log>
<property name="Message" value="Name Does Not Exist Lets redirect"/>
</log>
<property name="HTTP_SC" value="302"/>
<property name="Location" value="https://www.youtube.com/" scope="transport"/>
</else>
</filter>
<respond/>
</inSequence>
<outSequence/>
<faultSequence/>
</resource>
</api>
You can use the property mediator as below.
<property name="Location" expression="get-property('registry','REGISTRY_PATH')"/>
Below are the possible options for get-property method.
Read from registry
get-property('registry', String registryPath#propertyName)
get-property('registry', String registryPath)
Read from Java System property
get-property('system', String propertyName)
Read from the environment
get-property('env', String propertyName)
Read from a file
get-property('file', String propertyName)
Read from the context
You can use the class mediator or any other mediator and set the redirect url to the context and use the following property mediator to retrieve it from the context.
<property name="Location" expression="$ctx:ERROR_MESSAGE"/>
Please refer the documentation - https://ei.docs.wso2.com/en/latest/micro-integrator/references/mediators/property-reference/accessing-properties-with-xpath/#get-property-function
There are different ways to do this. One way is to read from environment variables. In the following example the Location property is set from the environment variable named REDIRECT_URL.
<property name="Location" expression="get-property('env','REDIRECT_URL')" scope="transport"/>
I have created a data service on Enterprise Integrator that searches a microsoft sql server database for a usercode, if the usercode I am searching for exists in the db the response is the users first name and last name. Is it possible for the user to get redirected to a c# webpage instead of their first name and last name being returned?
I am then calling my data service with my rest api, my intention is to search an microsft sql db and if the data is in the db I should be redirected to a c# webpage. However when I try to test my API I am getting back my json from the Result (Output Mapping) in my query from my data service. I am unsure how to resolve the conflict and any assistance would be greatly appreciated.
My Data Service Code:
`
<data name="restds" transports="http https">
<config enableOData="false" id="restdb">
<property name="carbon_datasource_name">REST</property>
</config>
<query id="query2" useConfig="restdb">
<sql>select UserCode,FirstName,LastName from UserDB.dbo.Users where UserCode=?</sql>
<result outputType="json" useColumnNumbers="true"> {
"users": {
"user": [
{
"UserCode": "$1",
"FirstName": "$2",
"LastName": "$3"
}
]
}
}
</result>
<param name="UserCode" optional="false" sqlType="STRING"/>
</query>
<resource method="GET" path="Users">
<call-query href="query2">
<with-param name="UserCode" query-param="UserCode"/>
</call-query>
</resource>
</data>
My REST API Code:
`<api xmlns="http://ws.apache.org/ns/synapse" name="DSAPI2" context="/dsapi2">
<resource methods="GET" uri-template="/{UserCode}">
<inSequence>
<call>
<endpoint>
<http method="GET" uri-template="http://localhost:8280/services/restds/Users"/>
</endpoint>
</call>
<filter xpath="$body//FirstName/text() != ''">
<then>
<log>
<property name="Message" value="Name Exists Lets redirect"/>
</log>
<property name="HTTP_SC" value="302" scope="axis2" type="STRING"/>
<property name="Location" value="https://wso2.com/" scope="transport" type="STRING"/>
</then>
<else>
<log>
<property name="HTTP_SC" value="302"/>
<property name="Location" value="https://www.youtube.com/"/>
</log>
</else>
</filter>
<respond/>
</inSequence>
<outSequence/>
<faultSequence/>
</resource>
</api>
`
I was expecting to redirect when testing the API, however the response body I am getting is:
{
"users": {}
}
Which is from the json in my data service
You can't do that in the dataservice. In REST API on Integration studio, while you get successful response, you can use HTTP redirect 302. Use property HTTP_SC with 302 code and http header with Location like below:
<property name="HTTP_SC" scope="axis2" type="STRING" value="302"/>
<property name="Location" value="https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections" scope="transport" type="STRING"/>
You can set the Location address to your c# website.
But I am not sure, if that that solution is not too awkward.
See docs:
Web/HTTP/Redirections and Web/HTTP/Headers/Location
As tmoasz mentioned. You can't do it in the Dataservice, what you can do is interface the Dataservice with an API and handle the redirection logic there. You don't have to use DbLookup or additional mediators to connect to the DB. Simply call your Dataservice from the API. Something like below.
<?xml version="1.0" encoding="UTF-8"?>
<api context="/checkuser" name="YOURAPI" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="GET">
<inSequence>
<call>
<endpoint>
<http method="get" uri-template="http://localhost:8290/rcsrest/Users">
<suspendOnFailure>
<initialDuration>-1</initialDuration>
<progressionFactor>-1</progressionFactor>
<maximumDuration>0</maximumDuration>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>0</retriesBeforeSuspension>
</markForSuspension>
</http>
</endpoint>
</call>
<filter xpath="$body//FirstName/text() != ''">
<then>
<log>
<property name="Message" value="Name Exists Lets redirect"/>
</log>
<property name="HTTP_SC" scope="axis2" type="STRING" value="302"/>
<property name="Location" value="https://to-someplace" scope="transport" type="STRING"/>
</then>
<else>
<log>
<property name="Message" value="Name is empty no redirection"/>
</log>
</else>
</filter>
<respond/>
</inSequence>
<outSequence/>
<faultSequence/>
</resource>
</api>
Update
Adding the Query Param to the Payload.
Note: GET request will not allow you to send Payloads in the request body, hence change the Dataservice method to a POST as well.
Dataservice
<data name="restds" transports="http https">
<config enableOData="false" id="restdb">
<property name="carbon_datasource_name">REST</property>
</config>
<query id="query2" useConfig="restdb">
<sql>select UserCode,FirstName,LastName from UserDB.dbo.Users where UserCode=?</sql>
<result outputType="json" useColumnNumbers="true"> {
"users": {
"user": [
{
"UserCode": "$1",
"FirstName": "$2",
"LastName": "$3"
}
]
}
}
</result>
<param name="UserCode" optional="false" sqlType="STRING"/>
</query>
<resource method="POST" path="Users">
<call-query href="query2">
<with-param name="UserCode" query-param="UserCode"/>
</call-query>
</resource>
</data>
API
<api xmlns="http://ws.apache.org/ns/synapse" name="DSAPI2" context="/dsapi2">
<resource methods="GET" uri-template="/{UserCode}">
<inSequence>
<payloadFactory media-type="xml">
<format>
<body xmlns="">
<p:_getusers xmlns:p="ws.wso2.org/dataservice/query2">
<xs:UserCode xmlns:xs="ws.wso2.org/dataservice/query2">$1</xs:UserCode>
</p:_getusers>
</body>
</format>
<args>
<arg evaluator="xml" expression="$url:UserCode"/>
</args>
</payloadFactory>
<call>
<endpoint>
<http method="POST" uri-template="http://localhost:8280/services/restds/Users"/>
</endpoint>
</call>
<filter xpath="$body//FirstName/text() != ''">
<then>
<log>
<property name="Message" value="Name Exists Lets redirect"/>
</log>
<property name="HTTP_SC" value="302" scope="axis2" type="STRING"/>
<property name="Location" value="https://wso2.com/" scope="transport" type="STRING"/>
</then>
<else>
<log>
<property name="HTTP_SC" value="302"/>
<property name="Location" value="https://www.youtube.com/"/>
</log>
</else>
</filter>
<respond/>
</inSequence>
<outSequence/>
<faultSequence/>
</resource>
</api>
I am very new in WSO2 ESB and I have the following doubt about how to implement an "if(){...} else{...}" like structure in my ESB project.
So in the input flow of the application on which I am working I have this property mediator followed by a log mediator that simply print the value of this property, something like this:
<property expression="count(//ds:Sample)" name="total_samples" scope="default" type="STRING" xmlns:ds="http://ws.wso2.org/dataservice"/>
<log level="custom">
<property expression="$ctx:total_samples" name="total samples: "/>
</log>
This works fine.
This total_samples property contains the number of record obtained from a previous call of a DSS service (I am not putting here in the code).
So the value of this total_samples property could be:
0: if the the query implemented by the DSS service returned 0 records.
A numeric value >0: if this query returned some records.
Now what I need to do at this time is only to chain a n "if(){...} else{...}" structure that print different log message if the total_samples property value is 0 or whatever number >0.
It should be a ver simple task but I have some doubts about how achieve it:
FIRST DOUBT: Looking on the online documentation it seems to me that exists 2 mediator that can be used to perform choice in the WSB flow: the switch mediator and the filter mediator. They seems to me very similar. What are the difference between these mediators? And what is better for my purpose?
SECOND DOUBT: It seems to me that these mediators works only on XPATH expression (something like count(//ds:Sample)), can they work directly on my property (something like "$ctx:total_samples") ?
THIRD DOUBT: At this stage I have implemented something like this in my flow:
<property expression="count(//ds:Sample)" name="total_samples" scope="default" type="STRING" xmlns:ds="http://ws.wso2.org/dataservice"/>
<log level="custom">
<property expression="$ctx:total_samples" name="total samples: "/>
</log>
<filter xpath="EXPRESSION THAT DO SOMETHING LIKE: $ctx:total_samples == 0">
<then>
<log description="No Resource Log">
<property name="message" value=""EMPTY RESULTSET, NO RESOURCES TO PROCESS""/>
</log>
</then>
<else>
<log description="Found Resource Log">
<property name="message" value=""Resources have been found, will be processed""/>
</log>
</else>
</filter>
Ok so my problem is: What have I to use as expression to enter in the case if the $ctx:total_samples value is 0 in the following line?
<filter xpath="EXPRESSION THAT DO SOMETHING LIKE: $ctx:total_samples == 0">
A more generic solution:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="testIfElse"
transports="https http"
startOnLoad="true">
<target>
<inSequence>
<payloadFactory media-type="xml">
<format>
<ds:Sample xmlns:ds="http://ws.wso2.org/dataservice">
<ds:INT_ID>1</ds:INT_ID>
<ds:INT_ID>2</ds:INT_ID>
<ds:INT_ID>3</ds:INT_ID>
</ds:Sample>
</format>
<args>
</args>
</payloadFactory>
<property expression="count(//ds:Sample/ds:INT_ID)" name="total_samples" scope="default" xmlns:ds="http://ws.wso2.org/dataservice" type="DOUBLE"/>
<property value="0" name="initial_value" scope="default" type="DOUBLE"/>
<property expression="fn:number($ctx:total_samples) > fn:number($ctx:initial_value)" name="result" scope="default"/>
<log level="custom">
<property expression="$ctx:initial_value" name="initial value: "/>
<property expression="fn:number($ctx:total_samples)" name="total samples: "/>
<property expression="$ctx:result" name="if total samples greater than initial value: "/>
</log>
<filter xpath="$ctx:result" regex="true">
<then>
<log description="Found Resource Log">
<property name="message" value=""Resources have been found, will be processed""/>
</log>
</then>
<else>
<log description="No Resource Log">
<property name="message" value=""EMPTY RESULTSET, NO RESOURCES TO PROCESS""/>
</log>
</else>
</filter>
</inSequence>
<outSequence>
<log level="full"/>
<drop/>
</outSequence>
<faultSequence/>
</target>
</proxy>
Use this expression
<filter xpath="fn:number(get-property('total_samples')) = fn:number(0)">
you are really asking three questions here so I'll try to answer all of them:
The Switch mediator allows for multiple cases, so for example you could have a case for count = 0, count = 1 and count > 1. The filter mediator on the other hand is like the classic if/else. If this than do x, else do .
The filter mediator can either work comparing some value with a regular expression using the 'source' and 'regex' attributes in which case it checks if they match. Or it uses the xpath attribute in which case it evaluates the result of the xpath expression as a boolean. In the xpath expression as well as the source you can refer directly to your property using $ctx. For example:
What you could do is
<filter xpath="fn:number($ctx:total_samples) = fn:number(0)">
I need to have a schedule job to read list of file names from DB and them upload them to a ftp site. How do I do that in WSO2 ESB?
Thanks
Updates (7/19/16): Based on the suggestions given, I wrote a stored procedure to return all file names in a xml format. Now that I need to figure out how to parse this xml formatted result and they can be ftp using fileconnector. Please let me know if my approach is workable. Thank you so much for your help.
<proxy name="FileUpload2CDGPS" startOnLoad="true" trace="disable" transports="https http" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<sequence key="FileLookupSeq"/>
<sequence key="SendFile2VendorSeq"/>
<send/>
</inSequence>
<outSequence/>
<faultSequence>
<drop/>
</faultSequence>
</target>
</proxy>
<sequence name="FileLookupSeq" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<log description="LogMessage" level="custom">
<property name="message" value="Find CDR files to upload"/>
</log>
<dblookup description="Get CDR files to be upload">
<connection>
<pool>
<password>***</password>
<driver>org.postgresql.Driver</driver>
<url>jdbc:postgresql://localhost:5432/esbcdrdb</url>
<user>***</user>
</pool>
</connection>
<statement>
<sql><![CDATA[SELECT * FROM find_cdr_file_to_upload(1)]]></sql>
<result name="xml_file" column="find_cdr_file_to_upload"/>
</statement>
</dblookup>
</sequence>
<sequence name="SendFile2VendorSeq" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<iterate attachPath="//files/files-set" description=""
expression="//files/files-set/file" preservePayload="true">
<target>
<sequence>
<property description="fileName"
expression="//files/files-set/file/name" name="fileName"
scope="default" type="STRING"/>
<property description="fileId"
expression="//files/files-set/file/id" name="fileId"
scope="default" type="STRING"/>
<property description="fileSource"
expression="//files/files-set/file/path" name="fileSource"
scope="default" type="STRING"/>
<property description="vendorId"
expression="//files/files-set/file/vendor-id" name="vendorId"
scope="default" type="STRING"/>
<property description="vendorDest"
expression="//files/files-set/file/vendor-dest"
name="vendorDest" scope="default" type="STRING"/>
<fileconnector.copy>
<source>{$ctx:fileSource}</source>
<destination>{$ctx:vendorDest}</destination>
<filePattern>{$ctx:fileName}</filePattern>
</fileconnector.copy>
</sequence>
</target>
</iterate>
</sequence>
There are many ways you can get this done.
You can directly write your requirement inside the schedule task, which handles the db connection and uploading the file to ftp site.
How to write a schedule task
Or You can invoke a proxy through a scheduled task sample can be found here. And inside the proxy you can connect to the db and get the required data and upload it to ftp using vfs, or you can write a custom mediator which get executed inside the proxy.
I am using 4.8.1.
I wish to authenticate against of Carbon Users-tore with plain text password.
If we use Username-tokens Signature its easy to do but my client having some other Header like
<soapenv:Header>
<mw:authentication soapenv:soa="http://schemas.xmlsoap.org/soap/soa/next" soapenv:mustUnderstand="0" xmlns:mw="http://soa.dev.com/mwoxy">
<mw:user>admin</mw:user>
<mw:password>admin</mw:password>
</mw:authentication>
</soapenv:Header>
So I wish to authenticate this inside proxy so that i wrote a proxy like this
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="authent" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<property name="username" expression="//mw:authentication/mw:user/text()" scope="default" type="STRING"/>
<property name="password" expression="//mw:authentication/mw:password/text() type="STRING"/>
<dblookup>
<connection>
<pool>
<dsName>jdbc/WSO2CarbonDB</dsName>
</pool>
</connection>
<statement>
<sql>select UM_USER_NAME from UM_USER where UM_USER_NAME=? and UM_USER_PASSWORD= ?</sql>
<parameter expression="get-property('username')" type="VARCHAR"/>
<parameter expression="get-property('password')" type="VARCHAR"/>
<result name="IsUserExisted" column="UM_USER_NAME"/>
</statement>
</dblookup>
<log level="full">
<property name="IsUserExisted" expression="get-property('IsUserExisted')"/>
</log>
</inSequence>
<outSequence/>
</target>
<description/>
</proxy>
So i wish authenticate against of Primary UserStore for that I used this query
select UM_USER_NAME from UM_USER where UM_USER_NAME=? and UM_USER_PASSWORD= ?
and changes done in user-mgt.xml file but its not working how would i do beacuse there is just 3 user and password's is there.
the configuration is like this
<UserStoreManager class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager">
<Property name="TenantManager">org.wso2.carbon.user.core.tenant.JDBCTenantManager</Property>
<Property name="ReadOnly">false</Property>
<Property name="MaxUserNameListLength">100</Property>
<Property name="IsEmailUserName">false</Property>
<Property name="DomainCalculation">default</Property>
<!-- <Property name="PasswordDigest">SHA-256</Property>-->
<Property name="StoreSaltedPassword">true</Property>
<Property name="ReadGroups">true</Property>
<Property name="WriteGroups">true</Property>
<Property name="UserNameUniqueAcrossTenants">false</Property>
<Property name="PasswordJavaRegEx">^[\S]{5,30}$</Property>
<Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property>
<Property name="UsernameJavaRegEx">^[^~!#$;%^*+={}\\|\\\\<>,\'\"]{3,30}$</Property>
<Property name="UsernameJavaScriptRegEx">^[\S]{3,30}$</Property>
<Property name="RolenameJavaRegEx">^[^~!#$;%^*+={}\\|\\\\<>,\'\"]{3,30}$</Property>
<Property name="RolenameJavaScriptRegEx">^[\S]{3,30}$</Property>
<Property name="UserRolesCacheEnabled">true</Property>
<Property name="MaxRoleNameListLength">100</Property>
<Property name="MaxUserNameListLength">100</Property>
<Property name="SharedGroupEnabled">false</Property>
<Property name="SCIMEnabled">false</Property>
</UserStoreManager>
Its not working how would i achive this
Thnks in advance
you are using a wrong approach. I believe you are trying to secure your proxy service using username and password. So basically you can secure your proxy from applying a username and password secure policy as shown in [1].
[1]. https://docs.wso2.com/display/ESB481/Applying+Security+Policies