Jasper server how get the parameters from the ReportExecutionRequest in jasper studio - jasperserver

I sent a ReportExecutionRequest to my jasper server CE, with one param into the ReportParameters list of ReportParameter.
The report parameter is like this:
ReportParameter{name='DOSSIER'limit='null'offset='null'select='null'criteria='null', values=[35201]}
after this is use this method to send the data to my jasper server:
return service.post()
.uri(builder -> builder.pathSegment("rest_v2", "reportExecutions").build())
.cookie(JSESSIONID, sessionId)
.bodyValue(reportExecutionRequest)
.exchangeToMono(response -> JasperServerResponse.fromBody(response, r -> r.bodyToMono(ReportExecution.class)))
.block(timeout);
Now I would like to use the param in jasper studio so I created a param named $P{DOSSIER} but for the post in my application the param is always null.
I did a try to post directly the value from postman to the server with this body and it works:
{
"reportUnitUri": "/applicationname/reportname",
"async": false,
"outputFormat": "pdf",
"parameters": {
"reportParameter": [
{
"name": "DOSSIER",
"value": [
15236
]
}
]
}
}
The only différence is the value without "s" into the reportParameter.class and my post request body but I used the reportParameter.clas from the jasper repository so I wonder how I could solve this.
Have you an idea?
Thanks in advance for your help

Related

How to send Query Params in Get Request in Robot Framework?

I am new to Robot Framework and am facing an issue while sending query params in Get Request method.
Following is the code that I tried with no luck :
Get Data With Filter
[Arguments] ${type} ${filter}
${auth} = Create List ${user_name} ${password}
${params} = Create Dictionary type=${type} filter=${filter}
Create Session testingapi url=${some_host_name} auth=${auth}
${resp} = Get Request testingapi /foo/data params=${params}
Log ${resp}
${type} has value new and ${filter} that I want is id:"1234"
I am expecting final url to formed as :
/foo/data?type=new&filter=id%3A1234
Instead of forming the expected url, I get the request url as :
GET Request using : uri=/foo/data, params={'type': 'new', 'filter': 'id:1234'}
I might be missing something very obvious but I cant figure out what it is. What can I change in this piece of code or any new code that needs to be added?
I think the logger is just outputting the params as the dictionary. The request should actually be made to foo/data?type=new&filter=id%3A1234
You can test it with the following request to Postman Echo (An HTTP testing service):
${auth} = Create List Mark SuperSecret
${params} = Create Dictionary type=Condos filter=2Bedrooms
Create Session testingapi url=http://postman-echo.com auth=${auth}
${resp} = Get Request testingapi /get params=${params}
${json} = To JSON ${resp.content} pretty_print=True
Log \n${json} console=yes
The response will correctly list the params you've encoded:
{
"args": {
"filter": "2Bedrooms",
"type": "Condos"
},
"headers": {
"accept": "*/*",
"accept-encoding": "gzip, deflate",
"authorization": "Basic TWFyazpTdXBlclNlY3JldA==",
"host": "postman-echo.com",
"user-agent": "python-requests/2.25.0",
"x-amzn-trace-id": "Root=1-5fb43ae9-1880b0a621c864b06ce1f54a",
"x-forwarded-port": "80",
"x-forwarded-proto": "http"
},
"url": "http://postman-echo.com/get?type=Condos&filter=2Bedrooms"
}

How to perform PATCH operation in Firebase APi?

The firebase doc sys this is how it is supposed to be done:
curl -X PATCH -d '{"last":"Jones"}' \
'https://[PROJECT_ID].firebaseio.com/users/jack/name/.json'
But I dont know how to convert this to a rest based request.
TO be clear I need to send a web request from javascript/java, hence I want to know what should be the body , and header and operation type for this request.
Can someone please help?
If you use the documentation for curl, you can figure out what that command line you showed is trying to tell you.
The HTTP method is: PATCH
The request body is: {"last":"Jones"}
The url is: https://[PROJECT_ID].firebaseio.com/users/jack/name/.json
Where PROJECT_ID is the name of your project. That's all there is to it.
You need teh following structure:
HTTP Request:
https://firestore.googleapis.com/v1/projects/*YOUPROJECT_ID*/databases/(default)/documents/users_admin/*DOCUMENT_ID*?**updateMask.fieldPaths=user_name&updateMask.fieldPaths=permisos.Administrador&updateMask.fieldPaths=user_email**
JSON Body (must be exactly the same structure and type as your database):
{
"fields": {
"user_name": { "stringValue": "Test Actualización 2" },
"permisos": {
"mapValue": {
"fields": {
"Administrador": {
"booleanValue": true
}
}
}
},
"user_email": { "stringValue": "veviboj548#eyeremind.com" }
}
}

How to get code coverage percentage for latest build from TFS 2017u2 using PowerShell & REST API

Using PowerShell, how can I query Team Foundation Server 2017 Update 2 (on-premises) to get the code coverage percentage metric from the latest completed gated check-in?
I've not found a clear API call to use in the MS reference documentation. In the web interface, I can see in the dashboard for a given completed build the percentage value and a link to download the entire Visual Studio coverage file. I don't want the file, though. I just want to make an API call and get the percent coverage value for the last successful build of a given definition.
Unfortunately, the docs for VSTS's REST API are down right now, but this should get you started (pulled from Google's Cache).
This endpoint handles everything related to Tests and Code Coverage.
https://{instance}/DefaultCollection/{project}/_apis/test/codeCoverage?api-version={version}[&buildId={int}&flags={int}]
Provide values for the following and then run this Invoke-RestMethod to get the data back.
$Instance = 'fabrikam-fiber-inc.visualstudio.com' #your URL here
$ProjectName = #YourProjectNameHere
$buildID = #YourBuildIDHere
$version = '2.0-preview'
Invoke-RestMethod -uri https://$Instance/DefaultCollection/$ProjectName/_apis/test/codeCoverage?api-version=$version
Here's a sample response you can get back:
Status code: 200
{
"value": [
{
"configuration": {
"id": 51,
"flavor": "Debug",
"platform": "Any CPU",
"uri": "vstfs:///Build/Build/363",
"project": {}
},
"state": "0",
"lastError": "",
"modules": [
{
"blockCount": 2,
"blockData": "Aw==",
"name": "fabrikamunittests.dll",
"signature": "c27c5315-b4ec-3748-9751-2a20280c37d5",
"signatureAge": 1,
"statistics": {
"blocksCovered": 2,
"linesCovered": 4
},
"functions": []
}
],
"codeCoverageFileUrl": "..."
}
],
"count": 1
}
It looks like blocksCovered and livesCovered are probably the closest you'll get from the API. Let me know if you need some help or get stuck. Eventually, the docs will be back online at this URL.

Wiremock bodyFileName templating

I'm using Wiremock to stub out some API calls made by mobile clients.
Struggling to get templated filename from request.
Can anyone confirm if this should even work with Wiremock standalone pls?
"response": { "status": 200, "bodyFileName": "Account-{{jsonPath request.body '$.user.identity'}}.json”}
I've got static files to be returned fine, just seems like bodyFileName doesn't like templating.
Example:
I configure wm with following Json:
{
"request": {
"method" : "GET",
"url": "/users/D8428899330"
},
"response": {
"status": 200,
"bodyFileName": "user-{{request.path.[1]}}.json"
}
}
Then when I attempt the url, http://localhost:9696/users/D8428899330 I get the following error,
HTTP ERROR: 500 Problem accessing /users/D8428899330. Reason:
java.lang.RuntimeException: java.io.FileNotFoundException:
/Users/iainframe/Documents/__files/user-{{request.path.[1]}}.json (No
such file or directory)
Should indicate that the file user-D8428899330.json resides in the correct location as I've hard coded it and it returns it ok. The command to start WireMock is:
java -jar ~/Documents/wm.jar --port 9696 --global-response-templating --verbose --root-dir /Users/iainframe/Documents/
The following response definition works fine for me with Wiremock 2.25.1 using the response template transformer.
"response": {
"transformers": ["response-template"],
"status": 200,
"bodyFileName": "user-{{jsonPath request.body '$.userid'}}.json" }
and this also works fine:
"response": {
"transformers": ["response-template"],
"status": 200,
"bodyFileName": "user-{{request.path.[3]}}.json" }
Interesting, I was running into the same problem and was able to solve it by starting WireMock with --global-response-templating. But you are using that parameter too... If it matters, I'm using WireMock 2.33.2.

calling UCWA with c# - lync 2013 server

I sent a get request to below url (I replaced my company's real domain name with xxx here)
http://lyncdiscover.xxx.com/?sipuri=abc#xxx.com
instead of getting this format according to many blog.
{
"_links":{
"self":{
"href":"https://lyncweb.sipdomain.co.uk/Autodiscover/AutodiscoverService.svc/root?originalDomain=sipdomain.co.uk"
},
"user":{
"href":"https://lyncweb.sipdomain.co.uk/Autodiscover/AutodiscoverService.svc/root/oauth/user?originalDomain=sipdomain.co.uk"
},
"xframe":{
"href":"https://lyncweb.sipdomain.co.uk/Autodiscover/XFrame/XFrame.html"
}
}
}
I got this format returned back without xframe (I replaced the domain with xxx):
{
"AccessLocation": "External",
"Root": {
"Links": [
{
"href": "https://lswebservice.xxx.com/Autodiscover/AutodiscoverService.svc/root/domain",
"token": "Domain"
},
{
"href": "https://lswebservice.xxx.com/Autodiscover/AutodiscoverService.svc/root/user",
"token": "User"
}
]
}
}
what do I miss here?
You will want to update your Lync Server 2013 environment - Updates for Lync Server 2013. UCWA went live with Lync Server 2013 (CU1) and what you initially hit is the Autodiscovery service which was updated in CU1 to return the format you are expecting above.
The information was contained on the last paragraph on ITAdmin-Configuration documentation.