WSO2 ApiManager Routing Database - wso2

I have a requirement with ApiManager DataService, I need to same request and same response but connect to different database based on a request attribute named year.
Is it possible? or I have to create a dataservice by year?
Thanks

You cannot conditionally change the Datasource based on a parameter.
If you want to use the same Dtaservice, you can have different contexts for the two requests like below. But still, you will have to add new query and the Datasource config.
<WSO2_URL>/Dataservice/getSomething/year1
<WSO2_URL>/Dataservice/getSomething/year2

Related

How to filter Reports result from Docusign Rest API in Postman

I want to download the result of one on my custom reports so I've configured Docusign Rest API in Postman and I use the Account--> reports/report_results method to obtain the data.
After configuring the body with the ID and the customID, I see that the data of the report is there but as I have a lot of data, I want to filter it by the date. Do you know how to do it?
This endpoint is not a public endpoint. Meaning, it was exposed by mistake in a prior swagger file, but now is hidden.
You cannot use this endpoint of the eSignature API as it will soon be completely removed (part of a deprecation process).

Camunda: use callActivity without tenant from tenant specific bpm

We have a multi tenant application and some tenants need a data pre processing to modify incoming data from third party modules.
Therefore we use tenant specific bpm's like in the image below tenant specific bpmn
There we need a callActivity to call an internal dataPreProcess which have no tenant defined.
The problem is, how i can set the tenant id to 'no tenant' so that the multi-tenant specific workflow is called?
Information:
We don't have a chance to deploy the internal data pre process as a tenant specific bpm, because the tenants are dynamic.
After i post the question it was so easy....
In the groovy script 'LF011' set a variable like
execution.setVariable('tenant', null)
So in the callActivity you can use '${tenant}' as the Tenant id, that's it....

Dynamic configuration of loopback REST connector

I am struggling heavily trying to configure a model using REST connector. I've read the official docs: https://docs.strongloop.com/display/APIC/REST+connector
and I find it extremely confusing.
My scenario requirements:
I'm connecting to several external REST services (always with the same baseURL)
different loopback Models should access different external endpoints
Basic authorization should be used, but the credentials differ from request to request
Some concrete questions:
should I have a datasource per model or only one (based on common baseURL)?
In case of only one datasource, how can I then dynamically set the concrete URL for each request?
How can I dynamically set the credentials for Basic authorization of a single request?

Getting partial responses through WSO2 DSS

I have setup WSO2 DSS 3.1.1 and have connected with an Oracle database. The service is setup well and working fine. Now what I want to try out is to see whether I can get the service to send partial json responses i.e. I can specify as a parameter in the service request what are the columns on the response I want and the service would return me those columns.
e.g. If i request for columns a,b,c then then the service would return me a,b,c columns and if I request for d,e,f columns it would send me only those columns.
Is this possible using WSO2 DSS or even ESB?
If yes how can it be established?
Thanks in advance.
You can try number of approaches.
Have two different data services for both cases and at ESB, route the request to correct service. That is, based on request call relavat dataservice.
You can filter out your return results based on the roles.
You can do change at dataservice. That is, define a stored procedure, where identify the input parameters and based on that return specific columns.

Salesforce: SOAP Login from Salesforce TO Salesforce

I implemented a batch job which makes a webservice call within the same salesforce instance, which then is supposed to send emails with a pdf attachment,
since you cannot send pdf attachments directly from a batch job. My webservice call looks like this:
public static void callOut(List ids){
InvoiceAttachmentConnector.InvoiceAttachmentService ws = new InvoiceAttachmentConnector.InvoiceAttachmentService();
ws.SessionHeader = new InvoiceAttachmentConnector.SessionHeader_element();
ws.SessionHeader.sessionId = UserInfo.getSessionId();
ws.handleInvoicePdfAttachment(ids);
}
However in batch jobs UserInfo.getSessionId() returns null, therefore i get a INVALID_SESSION_ID exception.
How can i log in to get a SessionId? So far I found no solution to login from salesforce to salesforce. If u can help I would appreciate it! Thanks!
You cannot get a session Id like this in batch apex as it runs under the system context and so has no specific user info for retrieval.
UPDATE:
You have the following options:
Try running the web services wsdl from your Salesforce org through the wsdl to apex generator in your org to generate some classes that may allow you to login. You are only allowed one web service request per execute call.
You could create a sites page that you make a HTTP get request to in your batch apex. This needs to retrieve the Ids of the items you want to send the PDFs for and a particular user to run as for you to use the System.runAs(user) method. You could pass these parameters in the HTTPRequest header or in a custom setting.
Note that neither of these solutions are ideal, you may want to reconsider why you are using Batch apex first of all and see whether you could reimplement it in a different way.