We want to use web service as a datasource in our Jasper Reports version 6.2. In Jaspersoft Studio version 6.2 (community) we have a Base URL defined as: https://mywebservice/location/
Content Type: GET Parameters
Name: param1, Value: $P{param1}
Our understanding is that the query generated by Jasper Reports will be: https://mywebservice/location/?param1=$P{param1}
Unfortunately the web service endpoint does not accept ?param1. Instead the URL should be: https://mywebservice/location/$P{param1}
What can be done in this case?
The standard syntax for the GET parameters is always paramName=paramValue, in your case you shouldn't use the GET parameters
In the server URI use the static part of your URL, so: https://mywebservice/location/
Then in the query use the parameter inside the Base URL area. The base URL will be appended to the static URI to form the full URL
Related
I have a multi tenant API and I am trying to RESTIFY it using wso2. I am trying a way to pass the tenant value in the url.
localhost:8290//tenant/api/...
https://tenant.xyz.com/api/...
I tried İntegration studio and i managed to pass a literal tenant value in http endpoint by creating a property named {uri.var.tenant} and setting it to tenant name. However, I don't know how can I take the tenant name from here
localhost:8290//tenant/api
and pass it here.
https://tenant.xyz.com/api/
I also tried using the APIM publisher page with no success.
As I see, there are 2 parts for your question.
How to parameterize the backend URL.
How to read the path parameter from the fronting API that is being called.
For the first one, the method you have followed is correct and an example can be found at https://apim.docs.wso2.com/en/latest/integrate/examples/endpoint_examples/using-http-endpoints/#example-1-populating-an-http-endpoint-during-mediation . What's remaining is to read the path parameter and to populating {uri.var.tenant} which is the second point.
For the second point, you can create and API definition with the URL templated. See the property URI Template at https://apim.docs.wso2.com/en/latest/reference/synapse-properties/rest-api-properties/ you can find an example of the usage at https://apim.docs.wso2.com/en/latest/integrate/examples/rest_api_examples/setting-query-params-outgoing-messages/#reading-a-query-or-path-parameter
For a Resource Name find the appropriate HTTP Rest URL for it.
With the help of the below Google Doc, for some resources name to URL mapping is working fine
Doc:
https://cloud.google.com/apis/design/resource_names#resource_name_vs_url
Example:
Name Format:
//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_NUMBER
URL:
https://cloudresourcemanager.googleapis.com/v1/organizations/ORGANIZATION_NUMBER
Basically adding HTTPS scheme before the name and the API major version before the resource path this works fine.
But the problem is this conversion scheme is not consistent for some resources if we form URL with this approach it will differ from the actual URL
Example:
Name Format: //compute.googleapis.com/projects/PROJECT_ID/
Formed URL: https://compute.googleapis.com/v1/projects/PROJECT_ID/
URL in Google Doc: https://compute.googleapis.com/**compute**/v1/projects
Compute Engine API Reference: https://cloud.google.com/compute/docs/reference/rest/v1
Other resources apart from compute also have actually different URL from the generated one using the above method.
Queries are:
Apart from the mentioned way is there any way to map resource names to URL
What are the best practices in such conversion
Apart from manually mapping each name to URL is there any generic way
Is there any API which provides this mapping, Like pass, a resource name and URL for it will be returned(On the internet I didn't found one)
Google APIs have a discovery document.
In that JSON file, there are 2 fields revelant for this question: rootUrl and servicePath.
To construct a proper URL for the API, concatenate both values.
More details in the discovery service docs.
I am working on upgrading a 3 year old api.ai app to DialogFlow. I have modified the request using the Migration Guide. I get a 404 error using the base url:
https://dialogflow.googleapis.com/v2/{session=projects/Project_ID/agent/sessions/1}:detectIntent
This is from the detectIntent documentation. I am trying to use the detectIntent method, but I was having the same problem when I tried to use context. Additionally, I have tried on multiple networks. I even get a 404 when I put it in a browser. Any idea what is incorrect in my URL?
As noted at the documentation for detectIntent, the URL uses Google API HTTP notation to document parameters and how they need to be specified. That second link isn't very useful, but basically it means that you can interpret the URL
https://dialogflow.googleapis.com/v2beta1/{session=projects/*/agent/sessions/*}:detectIntent
as
The parts outside the {} are literal. That is exactly what you should be sending in the URL.
The {} is not literal. It specifies a parameter.
The part inside the {} is a parameter named "session".
The "session" parameter takes the form of a string that has two portions that can be a single path segment (the description of detectIntent puts additional limitations on these portions, but sometimes this is specified in the notation) and the rest is a literal path.
So if the session is projects/12345/agent/sessions/6789 then the URL will be
https://dialogflow.googleapis.com/v2beta1/projects/12345/agent/sessions/6789:detectIntent
I have some external URL (restful api) to be integrated.
Those URL have different prefixed URL with different parameter at url, for example:
www.abc.com/books
www.abc.com/book/11
www.abc.com/book/11/authors
When get response from those invocation, esb needs to convert response from one json format to our standard json format.
I plan to use esb javascript mediator to perform convert operation, but I didn't find any way to attach url parameters.
Any one have any idea?
I have used mediator by java code to implement it, but it is too heavy.
I am also looking into connector for another option.
I have got a solution by use url template. By this solution, I can change url according to template defined.
With this solution, I didn't need to write mediator or connector.
I wish to update the proxy generated default Url. I have followed How to change WSO2 ESB URL but the solution provided there was not working and even i wish to block generating two urls for soap bindings depending on version.
Any help please
You have to redirect to the default URL from the main sequence of the ESB. Following article explains the configurations
http://achala11.blogspot.com/2012/08/access-wsdl-for-customuri-wso2-esb.html