Payeezy api integration - check events - java

I am trying to check my payeezy events online using follwoing url and api
https://developer.payeezy.com/payeezy-api/apis/get/events
I have set apikey and token and generated HMAC key for each time I generate request.
But getting following error response
Connection:
keep-alive
Content-Length:
206
Content-Type:
application/json
Date:
Fri, 27 May 2016 03:56:13 GMT
Server:
Apigee Router
{
"fault": {
"faultstring": "Execution of Hmac-authentication failed with error: Exception thrown from JavaScript : HMACERROR (hmac_helper#196)",
"detail": {
"errorcode": "steps.javascript.ScriptExecutionFailed"
}
}
}
Can anyone suggest why this happening with me :(

Related

Failed to pass the challenge for domain

Using certbot fails to generate certificate with this error:
org.shredzone.acme4j.exception.AcmeException: Failed to pass the challenge for domain www.
mysampledomain123.com, ... Giving up.
I manually checked the challenge file and got
http://www.mysampledomain123.com/.well-known/acme-challenge/jU--PkDrn5tDZw2RN6NNJHbPD00ovHFkLFvN3mJdeQX
Inside the file:
jU--PkDrn5tDZw2RN6NNJHbPD00ovHFkLFvN3mJdeQX.tuMr-UijwpsJ1KVZkdWTYgodWZ2SxxKdB7_CMAAEfpg
And here's the complete HTTP response header:
Accept-Ranges: bytes
Connection: keep-alive
Content-Encoding: gzip
Content-Type: text/plain;charset=iso-8859-1
Date: Sun, 16 Feb 2020 14:15:22 GMT
Server: nginx/1.14.0 (Ubuntu)
Transfer-Encoding: chunked
Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept
X-Powered-By: MyServer
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 0
I'm wondering whether the problem is with the HTTP response headers or the content itself.
Any ideas would be appreciated.

Rest : Response message is null

I have a rest API which I am testing using Jmeter. The response message assertion for message "OK" is failing.
Following are the response headers I see
HTTP/1.1 200
Set-Cookie: JSESSIONID=BE7C763B232F61E6DCECFSDEDEDB;path=/test-service;HttpOnly
X-Application-Context: test-service:DEFAULT,dev:8098
Link:
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Wed, 15 Feb 2017 09:14:30 GMT
Sampler Result
Sample Start: 2017-02-15 14:44:26 IST
Load time: 4422
Latency: 4418
Size in bytes: 4368
Headers size in bytes: 500
Body size in bytes: 3868
Sample Count: 1
Error Count: 1
Response code: 200
Response message:
When I test it through postman I get proper result
Can someone tell why this might be happening?
Note :
My Application is a spring boot app.
update :
this is not happening only in jmeter. I tried using Advance rest client
Got only the status code
If your response assertion is configured like the one given below, it shouldn't be failing. In case, if you are looking for the entire text "HTTP/1.1 200", ensure that "Response Headers" radio button is checked along with "Contains" in the pattern matching rules with text as "HTTP/1.1 200"
This is actually not jmeter issue.
HTTP/2 does not define a way to carry the version or reason phrase that is included in an HTTP/1.1 status line.
https://github.com/spring-projects/spring-boot/issues/6548
This is actually a Tomcat 8.5 issue as it starts to support HTTP/2 specifications.
To quote the comment in the relevant part of the Tomcat "Clients should ignore it (RFC 7230) and it just wastes bytes."

Json doesn't work with specified URL

I am a new programmer i am trying to build an app with Json.
If i use this URL doesn't work . http://zsuzsafodraszat.hostzi.com/boltok.json
if i Use this, my app working. https://api.myjson.com/bins/3zm8i
Both Json files exactly the same.
Can you help me what i am doing wrong ? Maybe bad extension or web000 is not a good service for Json ? Can you give me some good free json hosting ? Thanks
Those 2 urls do not have the same content or the same headers. You can see this if run curl commands from the command line:
$ curl -i "http://zsuzsafodraszat.hostzi.com/boltok.json"
HTTP/1.1 200 OK
Date: Wed, 13 Apr 2016 22:52:50 GMT
Server: Apache
Last-Modified: Wed, 13 Apr 2016 16:48:23 GMT
Accept-Ranges: bytes
Content-Length: 1020
Connection: close
Content-Type: application/json
??{"Aldi":"http://catalog.aldi.com/emag/hu_HU/print/Online_katalogus_04_07/Online_katalogus_04_07.pdf",
"Lidl":"http://www.lidl.hu/statics/lidl-hu/ds_doc/HU_HHZ_kw14_2016.pdf",
"Spar":"http://ajanlatok.spar.hu/view/download/?d=1279",
"Penny":"https://view.publitas.com/16538/136265/pdfs/016f82fb5b00bc97b5a8c35f512d89b01cd3e3ce.pdf",
"Coop":"https://view.publitas.com/2556/133497/pdfs/16603d7e9bf30e8a8a4efec7f01d3fa2caf92fe0.pdf",
"Auchan":"http://www.lidl.hu/statics/lidl-hu/ds_doc/HU_HHZ_kw14_2016.pdf"}
$ curl -i "https://api.myjson.com/bins/3zm8i"
HTTP/1.1 200 OK
Server: nginx/1.5.8
Date: Wed, 13 Apr 2016 22:52:56 GMT
Content-Type: application/json
Content-Length: 500
Connection: keep-alive
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
{"Aldi":"http://catalog.aldi.com/emag/hu_HU/print/Online_katalogus_04_07/Online_katalogus_04_07.pdf","Lidl":"http://www.lidl.hu/statics/lidl-hu/ds_doc/HU_HHZ_kw14_2016.pdf","Spar":"http://ajanlatok.spar.hu/view/download/?id=1279","Penny":"https://view.publitas.com/16538/136265/pdfs/016f82fb5b00bc97b5a8c35f512d89b01cd3e3ce.pdf","Coop":"https://view.publitas.com/2556/133497/pdfs/16603d7e9bf30e8a8a4efec7f01d3fa2caf92fe0.pdf","Auchan":"http://www.lidl.hu/statics/lidl-hu/ds_doc/HU_HHZ_kw14_2016.pdf"}
As you can see, one of them has a couple of junk bytes at the beginning that my terminal is displaying as question marks. Also the http headers are different. The Content-Lengths are wildly different too. Did you use something other than a plain text editor to create the json payload in the failing example?
Try removing the junk characters and adding these http headers:
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true

Why does response to my Java GET request have fewer headers than the same URL for Curl

I am playing with the OANDA API. The documentation states that responses to all successful GET requests will include an ETag header: http://developer.oanda.com/rest-live/development-guide/#etag
I have confirmed this is the case when I have a successful request with Curl:
$ curl -i "https://api-sandbox.oanda.com/v1/prices?instruments=EUR_USD"
HTTP/1.1 200 OK
Server: openresty/1.7.0.1
Date: Fri, 26 Dec 2014 17:27:01 GMT
Content-Type: application/json
Content-Length: 139
Connection: keep-alive
ETag: "6a6e222a3f90df8f333ff2a6edfb603e4a354905"
{
"prices" : [
{
"instrument" : "EUR_USD",
"time" : "2014-12-26T17:26:12.336249Z",
"bid" : 1.24105,
"ask" : 1.24119
}
]
}
When, however, I have a successful request with HttpClient org.apache.httpcomponents 4.3, the Content-Length and ETag headers are not included.
2014-12-26 17:27:54 INFO RestClient:91 - Executing request: GET https://api-sandbox.oanda.com/v1/prices?instruments=EUR_USD HTTP/1.1
2014-12-26 17:27:55 INFO RestClient:103 - Response OK, processing...
2014-12-26 17:27:55 INFO RestClient:108 - {
"prices" : [
{
"instrument" : "EUR_USD",
"time" : "2014-12-26T17:28:01.935790Z",
"bid" : 1.241,
"ask" : 1.24117
}
]
}
2014-12-26 17:27:55 INFO RestClient:110 - Headers: [Server: openresty/1.7.0.1, Date: Fri, 26 Dec 2014 17:28:14 GMT, Content-Type: application/json, Transfer-Encoding: chunked, Connection: keep-alive]
I am missing the ETag and Content-Length headers when I log all the headers received in response to my Java GET request.
I would like to use the ETag header in my Java code, so please can you help me understand why it is not returned.
HttpClient enabled compression by default and the OANDA API does not support ETags when compression is enabled:
Note: ETags can not be used in conjunction with compressed responses.

How do I POST a collection objects(with scaler attributes) using with Retrofit

I've tried using Retrofits "Rest Builder" with interface methods containing Java "Collections" or "Array List" as arguments, but always end up with 400 or 500 type errors.
Method in interface SvcApi
#POST(PATIENT_MEDSTAKEN + "/{patientID}")
public boolean submitMedsTaken(#Body ArrayList<MedicationTaken> medstaken, #Path("patientID") long id);
API build by:
private SvcApi symptomManagementService = new RestAdapter.Builder()
.setEndpoint(TEST_URL)
.setLogLevel(LogLevel.FULL).build()
.create(SvcApi.class);
RESULT:
JUnit Failure trace: retrofit.RetrofitError:500 Server Error
Eclipse Console:
---> HTTP POST http://10.0.0.5:8080/patient/medicationstaken/1
Content-Type: application/json; charset=UTF-8
Content-Length: 63
[{"Id":0,"taken":true,"timeTaken":1415132592031,"checkinId":2}]
---> END HTTP (63-byte body)
<--- HTTP 500 http://localhost:8080/patient/medicationstaken/1 (35ms)
: HTTP/1.1 500 Server Error
Content-Language: en-US
Content-Length: 501
Content-Type: text/html;charset=ISO-8859-1
X-Application-Context: application
Server: Jetty(8.1.14.v20131031)

Categories