How to authenticate birt report engine requests - spring

When designing report I was getting this error:
XML data source cannot be retrieved. XML data source file is invalid or the file doesn't exist.
It was asked.
Then I found out it was because the request was intercepted by my spring security plugin. Now I disabled the plugin for a moment and my report is working. But this is not solution!
So now I want to somehow configure the report engine to use its own username and password; To be used when sending the requests.
Is there any hook in the plugin for doing this or any other workaround?
Or
when render engine sends a request to the datasource url is possible to add params?
e.g http://app/report?param1="value"&param2="value". Putting such url on the report design data source field results in invalid url.
update:
I am not using database connection as datasource.
my data source is a service that return xml response.

I think that you need to have some basic user in your DB.
When you're using the code, use this user to make it, so this user will be used only for these cases.

Related

Nifi API Authentication - Access Token

I'm attempting to collect details about all processors on two installed instances of Nifi, versions 1.19.0 and 1.20.0. I want to use Nifi to do this so I can perform some minor ETLs and save the resultant dataset in a database. Both instances are configured as standalone authentication with SSL.
However, when I configure the InvokeHTTP processor how I think it should be to aquire a token, I'm getting a 400 status code and a response.body of "The username and password must be specified." on both instances.
Here's the super basic flow:
Nifi Flow
Here's what the error looks like:
Attributes of failed response
Here's the current config of the InvokeHTTP processor on the 1.20.0 instance which we can focus on from here out since they are both responding similarly.
Postman - InvokeHTTP Config
When I run the request with Postman, I get the expected token in the response body. And I'm able to make subsequent requests (the above config was a response from https://nifi06:8443/nifi-api/processors/39870615-0186-1000-e7d7-c59fa621ca7d in Postman).
I've tried the following:
Adding dynamic attributes for username/password as in the above configuration.
I've added them as JSON to the preceding Generate FlowFile processor's custom text.
And I've also tried using the Request Username/Request Password properties of the InvokeHTTP processor.
All return with the same response.body of "The username and password must be specified."
This seems it should be really simple and I'm sure I've been staring at it too long to see what I'm missing. Can anyone tell me where I need to specify the username/password?
Thanks.

Download different content types with spring

I need to expose a POST endpoint where the user uploads an excel file and based on some validations, I either send back the file with some information added to it along with json response OR just send status code as 200 OK(no data).
I am trying to do this in spring boot. I tried following link:
https://javadigest.wordpress.com/2012/02/13/downloading-multiple-files-using-multipart-response/
This works but needs adding boundary manually. Is there any other way to do it so that I can send both the data ?
You should use #Produces as it is written here: https://docs.oracle.com/cd/E19776-01/820-4867/ghrpv/index.html
You can define the MIME-Type of your payload.

OSB 12c Send Cookie in header

thanks in advance for the help!.
Well basically i have a business service and i have to send a request and also a header, in that header i need to put a Cookie, in oracle page documentation saids
To set a cookie using a complex XML expression, which is the Oracle Service Bus default format, configure the value of the HTTP Cookie header in the outbound request using the following expression syntax:
<cookie-values xmlns="http://www.bea.com/wli/sb/transports/http"> <value>{fn:concat("cookie_name", "=", "cookie_value")}</value> </cookie-values>
in the routing component i have a transport header like this
according to the documentation i send in XQuery expression this
But everytime i send the request the log show
i try use fn-bea:inlinedXML function to return an xml type or wrap it with quotes but always return the same error
and also i try to test the business service directly with the structure according oracle's page in bus console and i succesfully send with the Cookie
Thanks in advance (sorry for my english if you see any error)
Thanks again
I had the same issue today. I solved it by adding the following Java options on setDomainEnv:
-Dcom.bea.osb.http.cookieAsNoComplexElement=true

Magento session expires immediately

I have the following problem. when I call the login method of the Magento's SOAP API, using java. the return is a session that expires immediately.
I am using Apache Camel and Magento v2 SOAP API
I found the solution. In my xls file, some diference between the generated xml and the soap client xml make a invalid response, but not show any error. I solved just copying the xml in my xls as below. so make sure that your xml is equal to xml model in soap client.

Does Jmeter saves the randomly generated email id (pre-processor-user parameters) in the database

I have used Jmeter's pre-processor 'user parameters'to generate random email ids to test singup api, able to susscefully generate and signin. However not able to see the randomly generated email id in the database (using mongoDB), it is not stored in the DB.
Does jmeter saves the email id in the DB?
By default JMeter doesn't store anything into the database. If your API sign-up process assumes storing email of the signing-up person to the database - something is wrong with your test scenario.
JMeter automatically considers HTTP Status Codes below 400 as successful, it doesn't do any checks of the response body so my expectation is that you are receiving pseudo-successful responses having errors or exceptions inside. Add View Results Tree listener to your Test Plan - it is capable of visualizing request and response details and inspect them carefully. If there are errors - fix them until you will be happy with your script behavior, after that the listener can be disabled.
You can also use JMeter Assertions, i.e. Response Assertion to validate whether response contains message regarding successful sign up.
Don't forget to add HTTP Header Manager to send the relevant Content-Type header as some API servers don't process the requests not having expected MIME type.
See Testing SOAP/REST Web Services Using JMeter article for more information on APIs load testing.

Resources