Specifying connection parameter values as registry entries in DB report mediator in WSO2 EI - wso2

I am trying to insert data into a database using the DB report mediator in WSO2 EI. Using Integration Studio 8.0.0 for developing the API. Everything works fine on hardcoding the connection parameters inline as shown below.
Now, I want to specify the connection parameters as registry entries. So, created local entries under registry config. But not sure how to set them as parameters in DB report configuration. When I tried as below, it reads the entire content of the registry local entry instead of just the value and fails. Need suggestions on how we can set the connection parameters as registry entries?

Related

API MANAGER 3.0 - API PUBLISHER NOT LOADING

I am doing a POC with my team as we are introducing WSO2 components and am working with the API Manager 3.0.
I seem to be having issues loading the WSO2 API Manager / API Publisher on the defined URL;
https://[ip address]/publisher
The page is not loading and I keep getting a spinning circle.
Steps I have taken:
Stop API Manager at command prompt with [Ctrl + C] command
Modified deployment.toml file specified paths for the localhost to our IP Address, API [publisher, gateway and store] URL values to use our IP Address as well.
Changed carbon.xml and api_manager.xml
Start API Manager with wso2server.bat --run command
Issues are as follows;
api_manager.xml values are reset to localhost and not the IP Address I modified it to.
The API Publisher page is not loading and I am not able to get to the API Publisher login page.
I am an administrator on the Windows Server hosting this, so all changes are made as admin.
First of all, APIM 3.0 has a new config model, where all configurations are available (only) in deployment.toml. All other configurations are populated based on that, and shouldn't be changed manually.
Second, you don't need to replace all occurrences of localhost to IP as many are local calls.
Third, the correct URL should have the port, unless you have a reverse proxy in front of API.
eg. https://[ip address]:9443/publisher
Sounds good and thanks for the input. I will give this a try and post back to the thread.
I am using the IP and Port for now with no reverse proxy but plan to add one, once I can get through this part.
Much appreciated.

Using placeholders in WSO2 DSS dbs files for DB connection params

Is it possible to use placeholders in WSO2 DSS db connection params - e.g. ${prod.db.url} and replace them in runtime from Registry?
Thanks.
The datasource connection is checked and established in the dataservice deployment time. Therefore, you have to provide the datasource configurations such as driver class name, connection url. etc. at the deployment time.
Since the datasource configurations like db url, driver name, user name, password is needed during deployment stage, its not possible to refer the same from registry.
I assume your requirement comes from the need to manage different environments, to achieve the same, have the option to create datasources at server level, called Carbon_Datasources.
These datasources can be referred from .dbs file like the below one. In the below example, serviceDS is the datasource configured.
<config id="rs">
<property name="carbon_datasource_name">serviceDS</property>
</config>
<query id="deliveryService" useConfig="rs">
Refer here for adding different types of datasources and here for managing the same.

How can I create an XML document starting from data retrieved from a database using WSO2 techonologies?

I am absolutly new in WSO2 technology. I am working on a WSO2 Enterprise Integrator project using ESB and Data Service Server to extract some data from database tables.
So what I have to do is to generate a complex XML document starting from the data retrieved from the database by some queries.
So I have to:
Perform some queries using Data Service Server
Then using these retrieved data to build an XML document that use these data for the XML field values, something like this:
<?xml version="1.0" encoding="UTF-8" ?>
<singleField>value related to a record obtained by QUERY 1</singleField>
<multipleField>value related to a record obtained by QUERY 1</multipleField>
<multipleField>value related to a record obtained by QUERY 1</multipleField>
<multipleField>value related to a record obtained by QUERY 1</multipleField>
So for example I will have 2 different simple select query:
QUERY 1: that always will return a single row: the obtained value have to be putted as value of the ... XML field
QUERY 2: that may return multiple record, so for each of the returned record I have to put a new ... element into my XML (using the related record value obtained by the query as value of this XML element).
WSO2 allows me to create an XML document in this way? What is the best tool (in WSO2 techonlogies set) to do it?
You can build a proxy service , that will invoke a soap data service and write it to a file for you
Generate or create the data service via the DSS : (sql -> soap service (DSS))
https://docs.wso2.com/display/DSS310/Developing+Data+Services
Integrate with the Data Service via an ESB Proxy service. (soap service (DSS) -> proxy (ESB) -> file) The output of the file can be done via :
VFS transport (http://wso2.com/library/articles/2011/01/wso2-esb-example-file-processing/)
File connector (https://docs.wso2.com/display/ESBCONNECTORS/Working+with+the+File+Connector+Version+2)

WSO2 api manager configuration

I'm using wso2-am 2.
I have enabled analytics (from api-manager.xml) and modified DASServerURL to use port 7714 instead of 7712.
But I'm getting theses exception:
org.wso2.carbon.databridge.agent.exception.DataEndpointSecurityException: Error while trying to connect to ssl://localhost:7712
at org.wso2.carbon.databridge.agent.endpoint.thrift.ThriftSecureClientPoolFactory.createClient(ThriftSecureClientPoolFactory.java:61)
It look like it is still using the old port 7712?
A second question, I know that the api manager is persisting the configuration in it's database, so my question is: if i modify for example api-manager.xml, will it update the new setting in the DB or how to force this update?
Thanks
You have to change port settings in two places.
<APIM_HOME>/repository/conf/api-manager.xml
<APIM_HOME>/repository/conf/log4j.properties only if you have added DAS_AGENT to log4j.rootLogger
By default analytics distribution port offset set to 1 in carbon.xml. But it seems you have set it to 3. Make sure to change the port in above two places.
The answer to your second question is, API-M persist API data in the database. There are certain server configurations such as user data, registry data persisted in the database. But above configuration is not persisted and if you changed it, you have to restart the server to effect that.
Hope this would help you.
1.if your DAS offset is 3. You should set the tcp port is 7614 and restart your APIM. your 7612 is configed in apim, cannot change on admin-dashboard.
2.when you change the *.properties or *.xml.I suggest you restart your app.

WSO2 identity server external JDBC store

I want to use a external JDBC store as default store instead of the default LDAP store. Followed the documentation in this link.
http://docs.wso2.org/wiki/display/IS400/Configuring+an+External+JDBC+User+Store
Getting the following exception Appreciate any help.
An unknown exception occurred while starting LDAP server.java.lang.NullPointerException: Name is null
You can configure WSO2 IS 4.0.0 with an external JDBC users store.The problem is due to an issue with the instructions in the documentation(1) as some configuration steps are missing there.I have created the jira [DOCUMENTATION-17] to track this doc issue.
Please follow below steps to connect IS 4.0.0 with external jdbc users-store.
1) Change the UserStoreManager class to JDBCUserStoreManager from user-mgt.xml [IS_Home/repository/conf] and add the related database connection property to it as mentioned in (1)
2) Add 'passwordHashMethod' propert within JDBCUserStoreManager and set the value to 'SHA' or 'PLAIN_TEXT' in {IS_HOME}/repository/conf/user-mgt.xml.
Eg: <Property name="passwordHashMethod">SHA</Property>
3) Set value of the 'MultiTenantRealmConfigBuilder' property to 'org.wso2.carbon.user.core.config.multitenancy.SimpleRealmConfigBuilder' in {IS_HOME}/repository/conf/user-mgt.xml.
Eg: <Property name="MultiTenantRealmConfigBuilder">org.wso2.carbon.user.core.config.multitenancy.SimpleRealmConfigBuilder</Property>
4) Enable JDBCTenantManager in tenant-mgt.xml and comment out the config section for CommonHybridLDAPTenantManager.
Once you did above configurations,you'll able to configure WSO2 Identity Server to an external jdbc user store successfully.
(1) http://docs.wso2.org/wiki/display/IS400/Configuring+an+External+JDBC+User+Store
I was able to resolve this.
Start with a clean install of WSO2 IS 4.0.0 if possible.
Apart from following the directions given in the documentation to setup a JDBC datastore; you need to do the following :
Enable JDBCTenantManager in tenant-mgt.xml and comment out CommonHybridLDAPTenantManager2
Set the enable property to false for EmbeddedLDAP in embedded-ldap.xml