sending the following REST filter to a loopback endpoint
filter[where][and][0][polity]=true&filter[where][and][1][or][0][code]=test&filter[where][and][1][or][1][name]=test
produces this where JSON object:
{"and":[{"polity":true},{"or":[{"[code]":"test"},{"[name]":"test"}]}]}
Please note the unnecessary square brackets around code and name.
It should be a simple logical test
polity=true & (code=test || name=test)
sending the (corrected) JSON to the endpoint works fine.
loopback version: 3.0.0 and 2.22.0
is it a known bug?
which loopback module is responsible for convert the request parameters to where object?
Related
I'm using JMeter to test a microservice and I need to use a parameter dynamically with a different value in each request. Also, the parameter is a part of a query that contains other constant values as well.
I defined user variables in the JMeter user.properties file (in JMeter bin folder):
JMeter -- bin/user.properties
# Parameters to use in JMeter
ES_HOST=127.0.0.1
ES_PORT=9200
ES_INDEX=segments
ES_TYPE=_doc
THREAD=5
CSVDATA_ROOT=C:/devtools/apache-jmeter-5.2.1/csv_data
Of course, I have User-Defined Variables:
And how my Test Plan is defined in JMeter
As you can see in the following screenshot of View Result Tree the parameter agentName I defined and shown in the HTTP Request (above) is working.
I want to define it in the body of the HTTP Request, to replace the hardcoded "John Doe" with a parameters that have a different value in each request.
"query":"SearchStartTime=2020-01-01 00:00:00.000TO2020-01-31 23:59:59.999&AgentName=John Doe"}
How can I do that?
I need a way to add a parameter to an existing string
I've already tried Using Apache JMeter to Test Elasticsearch (or any REST API) and In Jmeter, What would be syntax of parameters in Body Data section of HTTP Request Sampler, for Rest APIs and input should be generated dynamically also doesn't solve my problem.
Use same syntax as HTTP request - ${agentname} for getting variable value:
"query":"SearchStartTime=2020-01-01 00:00:00.000TO2020-01-31 23:59:59.999&AgentName=${agentname}"
I am trying to anonymize images before sending them to another Orthanc server.
According to the documentation on anonymization, Orthanc can anonymize images through the REST api:
http://book.orthanc-server.com/users/anonymization.html
Orthanc allows to anonymize a single DICOM instance and to download
the resulting anonymized DICOM file. Example:
$ curl http://localhost:8042/instances/6e67da51-d119d6ae-c5667437-87b9a8a5-0f07c49f/anonymize -X POST -d '{}' > Anonymized.dcm
According to the documentation page on Lua scripts, Lua scripts can take advantage of the REST API:
Lua scripts have full access to the REST API of Orthanc
The page goes on to describe how to use call the REST API from Lua:
functions:
RestApiGet(uri, builtin)
RestApiPost(uri, body, builtin)
RestApiPut(uri, body, builtin)
RestApiDelete(uri, builtin)
The uri arguments specifies the URI against which to make the request, and body is a string containing the body of POST/PUT request.
This means that I should be able to call the REST API from Lua by combining the functions above.
However when calling the RestApiPost as described in the documentation.
instances = RestApiGet(http://localhost:8042/instances, true)
I get the following error
E0313 17:40:40.851840 LuaScripting.cpp:358] Lua: Badly formatted URI
E0313 17:40:40.851884 LuaScripting.cpp:361] Lua: Error in RestApiPost() for URI: http://localhost:8042/instances/b38a8ef0-909f8ac0-7eca907a-75c98187-8e5339f4/anonymize
It's worth noting that I can call this endpoint correctly from curl and from my browser. Removing the 'http://' section didn't solve the issue.
The RestApiGet function and its family expect the developer to format the uri parameter without 'http://localhost:8042' as follows:
'/instances'
These functions only work for using the REST API provided by the Orthanc the Lua script is running on, so it already knows that you will use the localhost and it will use the correct http scheme and 8042 port automatically.
As described in http://book.orthanc-server.com/users/lua.html#general-purpose-functions, the function HttpGet(url, headers) and its family are the general form of this function and allow the developer to query any http endpoint.
I am working with the following documentation to implement REST-based searching using Confluence CQL: https://developer.atlassian.com/confdev/confluence-rest-api/advanced-searching-using-cql and https://docs.atlassian.com/atlassian-confluence/REST/latest/#d3e648
I am able to do GET requests using the user id / password against other endpoints against my Confluence Cloud account. However, when I try to pass a CQL query to the search endpoint, as follows:
text ~ Tomcat
I get the following error:
{
"statusCode":400,
"data":
{"authorized":false,"valid":true,"errors":[]},
"message":"Could not parse cql : text %7E Tomcat"
}
Can anyone tell me what may be causing this? It looks like the CQL encoding for passing in HTTP GET is causing an error on the back end somehow. I am using Java to encode my GET parameters with UTF-8. This exact approach works just with with JIRA Cloud search using JIRA Query Language (JQL), so I'm confused what's going on here.
The endpoint I use is:
https://mycompany.atlassian.net/confluence/rest/api/content/search?
I have tried it with HTTPS and HTTP. I understand that for the search endpoint, a 400 response means "Returned if the CQL is invalid or missing" - any ideas what I'm missing here or what may be wrong with my CQL?
The authorization error is caused by you not being logged into your confluence instance...
Try logging in and use a url like this one (in some instances the confluence/ isn't needed)
https://mycompany.atlassian.net/confluence/rest/api/content/search?cql=space=DS
i am using Jmeter to simulate multiple users to upload a file into server
i used Badboy to record a script and export it to Jmeter
to upload a file a need to get the UUID that is responded by the server so i can use it for the rest of the HTTP request i have tried to use regular expression extractor using this expression
${UUID} = \S*
but it did not work also i used the uuid function to generate a random UUID but i could not configure it in a way to make the request repeated until match the UUID the have been returned by the server
any one can help me?
For extracting UUID you'll need to configure Regular Expression Extractor Post Processor as follows:
Reference Name: anything meaningful, i.e. UUID
Regular Expression: for Version 4 UUID it would be something like ([a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12})
Template: $1$
You can test your regular expression against returned data using View Results Tree Listener (select RegExp Tester from dropdown)
For more information refer to Using RegEx (Regular Expression Extractor) with JMeter guide.
In BizTalk 2006, I am trying to set up a messaging-only scenario whereby the recieved message (a string) is passed to a web service method that takes a single string parameter. In other words, the whole body of the BizTalk message should be passed as the parameter to the web service call.
The service method looks like this:
[WebMethod]
public void LogAuditEvent(string auditEventMessage)
I have set up the assembly with the proxy class in the SOAP adapter configuration as required, but I can't figure out how to get the message body to be passed as the parameter. Without doing anything special, I get the following error message:
Failed to serialize the message part
"auditEventMessage" into the type
"String" using namespace "".
I think this means that the adapter cannot find a message part named after the parameter. So, my question is what do I need to do to get my message set up correctly? I was thinking that maybe I needed to add an outbound map, but was not sure what to use as the source schema and how to generate a proper schema for the web service request message.
Does anyone have any pointers on this seemingly simple task?
Thanks.
TDL,
I would take a look at the links below for some tips on how to do this. SOAP adapter can be problematic I would recommend WCF if your using R2. And if not look at the WSE adapters as well.
http://blogs.digitaldeposit.net/saravana/post/2007/01/31/Calling-Web-Service-from-BizTalk-2006-in-a-Messaging-only-Scenario-(aka-Content-based-Routing).aspx
-and-
http://www.pluralsight.com/community/blogs/aaron/archive/2005/10/07/15386.aspx
-and-
http://social.technet.microsoft.com/Forums/en-US/biztalkgeneral/thread/92f2cad3-39b9-47d0-9e6f-011ccd2f9e10/
-Bryan