how to upload file in Advanced Rest Client - rest

I am trying to use post method in this add Attachment to SAP ODATA service (URL), then I am getting the error
"Key 'file_name' not given".
I used Multippart/form-data and given file_name (with single cotes and with out it) still the error is same.
Any idea where to give file_name?
Thanks.

Related

Apache ManifoldCF: Get a history report for a repository connection over REST API

I'm trying to get a history report for a repository connection over ManifoldCF REST API. According to the documentation:
https://manifoldcf.apache.org/release/release-2.11/en_US/programmatic-operation.html#History+query+parameters
It should be possible with the following URL (connection name: myConnection):
http://localhost:8345/mcf-api-service/json/repositoryconnectionhistory/myConnection
I have also tried to use some of the history query parameters:
http://localhost:8345/mcf-api-service/json/repositoryconnectionhistory/myConnection?report=simple
But I am not sure if I am using them correctly or how they should be attached to the URL, because it is not mentioned in the documentation.
The problem is also that I don't receive any error, but an empty object, so it is difficult to debug. The API returns an empty object even for a non-existing connection.
However it works for resources, which doesn't have any attributes, e.g.:
http://localhost:8345/mcf-api-service/json/repositoryconnectionjobs/myConnection
or
http://localhost:8345/mcf-api-service/json/repositoryconnections/myConnection
Thanks in advace for any help.
I also wrote a message to ManifoldCF team and they gave me an answer. So I summed up it for you below.
Query parameters go after the fixed "path" part of the URL and are of the form ?parameter=value&parameter2=value2...
So in the same way as in any other URL.
The problem was that I didn't supply the activity(s) that I wanted to match. Possible activities are e.g. fetch, process. My example:
http://localhost:8345/mcf-api-service/json/repositoryconnectionhistory/myConnection?activity=process&activity=fetch
Finally, the reason why I didn't get an error when I used a connection name that is bogus is because the underlying implementation is merely doing a dumb query and not checking for the legality/existence of the connection name.

How can I pass a parameter from XML Response tag in a new GET XML Request in Soap UI?

I have tried to find a solution in this community in different threads but yet to find one that I am looking for.
I am using SoapUI version 5.3.0 My Application have a couple of RESTful APIs. Initially I am sending json request to a WebService and getting back the following XML Response:
<StartDataExtractResult xmlns="http://schemas.datacontract.org/2004/07/AriaTechCore" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<StatusCode>1</StatusCode>
<StatusText>success</StatusText>
<RequestNumber>397</RequestNumber>
</StartDataExtractResult>
As soon as RequestNumber tag is generated. I have to access to 2 more XML EndPoints (where the value of RequestNumber is appended) to know the Status as below:
A. http://quickextract.quickaudit.in/webs/quickextract.svc/GetExtractionDetails/396
B.
http://quickextract.quickaudit.in/webs/quickextract.svc/GetRequestStatus/396
As of now, I have created the 2 seperateTestSteps for the above mentioned XML Endpoints:
A. http://quickextract.quickaudit.in/webs/quickextract.svc/GetExtractionDetails/
B. http://quickextract.quickaudit.in/webs/quickextract.svc/GetRequestStatus/
Now I need to append the value within tag in the GET Request to get back a response from the WebServices.
Update:
I have created a 'Property Transfer' at Testsuite level as "TSreqNum". This 'Property Transfer' is getting updated as per the initial Response. But I am not sure how would I append "TSreqNum" to construct the complete GET Request as:
http://quickextract.quickaudit.in/webs/quickextract.svc/GetExtractionDetails/TSreqNum
Can anyone help me out please?
You can use the property within the URL of the GET request:
http://host:port/path/${#TestSuite#TSreqNum}
The URL gets updated with the property value.

Confluence REST API Search - Error with encoding CQL query for HTTP GET

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

Talend ESB : How to validate XML request against a XSD file

I am using Talend Open Studio 5.4.
I have created a service, which on finish generates all schema required for the same service. I have assigned a new job for the service and trying validate input XML request against the request XSD file.
I followed this link, it worked fine, but when I tried to validate an input XML request, as tESBProviderRequst will receive, it did not work.
How to do it?
I'm not a Talend expert, but the way i do this is by transforming first my payload (which type is a "document") into a string, so that the tXSDValidator could work.
The second conversion is just here to allow me to build a custom response with my input fields.
But in any cases, i think you have to pass a document object to your tESBProviderResponse.
I hope it helps.

How to produce both xml and json for a rest based service?

I am trying to produce both xml and json from my rest service.
#Produces({"application/xml", "application/json"})
However, when I try to use the service using curl/SOAPUI, I get back either xml or json depending on which is mentioned first. In simple words, only the first method is considered. Is there a workaround?
You should check this link out - oracle docs for #Produces
The spec says that it does indeed default to the first one if that is acceptable as specified by the media type on the request. You should check your soapUI tool and see what headers you are sending. If they are both being sent you will get a response with the first one listed in your #Produces annotation.