I tried to send an IPN (from the simulator) to my play framework url!
the url looks like that: http://host/checkout/sub
Server is running on port 80. The problem is that the ipn request doesn't even call the linked method. (So the method that i just defined in the routes is never called, if I request an ipn), but still there is an incoming request!
If i try to call the URL via browser, I don’t experience any problems and the method is called properly.
So did anyone else face that problem?
Should I try another way?
Help is very appreciated!
Kind Regards,
Paul
Edit: I get that exception after about 5 minutes
[error] p.nettyException - Exception caught in Netty
java.lang.IllegalArgumentException: empty text at org.jboss.netty.handler.codec.http.HttpVersion.(HttpVersion.java:97) ~[netty-3.9.8.Final.jar:na]
Finally...
1) I had to fix some settings at my service provider (Open Internet -> yes)
2) I had to change the port to 80 (was on 9000 for testing)
3) The exceptions by play and paypal didnt really say anything... wireshark did, once again, a good job: in my routes files i defined the rout as GET but of course they are sending their data via POST (stupid mistake :P)
Kind regards
Related
I have been tasked with determining why certain tests are failing in Postman's collection runner. I found this question helpful but it does not address the scope of my issue.
This post suggests I could be sending the request with invalid JSON, but I did not write these tests, so I am unsure of how to check that.
My collection runs 423 GET/POST tests:
280 pass
143 fail
100% of all GET tests pass, as well as some POST tests.
However, all tests that fail are POST tests. Of these:
Almost all of them get a 500 Internal Server Error
They do not log a Response Header or Response Body
So far, I have ensured the app server is listening on the correct ports, and I've restarted the server a few times. Beyond this I'm unsure of how to proceed; most of my experience is in Java desktop applications but I'm now tackling this web application.
What steps should I try next?
A 500 error could be almost anything, and in general you would need to look at server/app logs to figure out what happened. The error could have been thrown because of something unexpected/catastrophic or simply because the server (or rather the programmer/admin) didn't want to expose any more information.
With that said, I would also make sure that your POST request is being sent to an endpoint that is listening/expecting a POST and that the request is properly formatted.
I'm writing a Java app. When I try to make a request to an API using OkHttp, nothing is returned. When I went to the request URL in a browser, I got the response {"Message":"The requested resource does not support http method 'GET'."}
I can only find help online if you're the one hosting the server. Is there anything I, as the one making the request, can do? Or do I have to wait until the API people can fix it?
You fool, you just assumed that the problem with your request was caused by the message in the browser! In actuality, it was a bug in your Android emulator. You simply needed to cold boot the emulated device, and it was fixed!
I am trying to learn WSO2 but have been stuck at a minor step which i believe should be quite easy to do. While creating a new api i need to give the production endpoint. What i want to give is the url along with the port as well. So it should be something like this:
Production Endpoint : http://localhost:9000
However this gives a invalid url. How can i specify port along with it. Please help. I have tried to go through the docs but could not find anything. I am doing these through the admin UI available at http://myip:9443/publisher.
Please advice
Edit: Adding image for clarity
The Test button will send HTTP OPTION request to the endpoint, and if the endpoint supports HTTP OPTION request, then it will be shown as Valid, otherwise, it will be shown as Invalid
As far as your backend point support the HTTP method you need, you don't need to worry about this Test button against the endpoint.
For some reasons I need to develope an own HTTP client. I managed working with the HTTP protocol, but I don't know how to send it via java...
For example, I got the following request message I want to send (I couldn't test it, so I am not sure that it is in a correct format):
GET http://example.com HTTP/1.1
Transfer-Encoding:UTF-8
someOtherParam=thatIsThis&name=value
All I could find was making up a connection using URL.openConnection() - but with that connection, I can't send the whole message, but have to put the header values via the connection.addRequestProperty() method.
Can anyone help me and tell me how to send such a message to a server?
(And yes; I do know libraries like Apache HttpComponents :))
Best greetings,
Martin Bories
thanks for your help - Sockets did it :).
For anyone who is running into the same problem: Use sockets - you can simply write and receive messages and implement an own HTTP implementation.
We are facing a peculiar issue at the moment and we have no clue what is causing this.
We have a web-service hosted on serverA.
When this web-service is invoked from serverB (using the command, curl http://serverA:8008/service/getId), we get the required response. (the web service returns an Id which is an integer).
When the same web-service is invoked from serverC, we get the required response but the digit 2 in the response is getting replaced by _ .
For example, we get 5002 when the web-service is invoked from serverB.
When the same web service is invoked from serverC, we get 500_
We checked the wireshark details from serverA and the data going out from serverA is the same for both the servers.
We have no clue at the moment why this is happening. I would like to add that serverC is in DMZ while serverB is not.
Any input/help in this regard is highly appreciated.
by gather the facts that
1. Server doesn't change the response by its own.
2. Web Service is giving the same response for the same input.
only culprit is your firewall, can you stop it for testing purpose and see if the response is coming as expected. OR
Try to check the firewall settings and create a hole/exception for web Service.
Thanks everyone for your efforts, the issue is now resolved. It was an incorrect firewall rule that was causing this. I asked our network engineer how the firewall setting can alter http response body and following is the reply I got:
For certain protocols the firewall does deep-level packet inspection,
so rather than just check the port number it actually looks into the
payload. This allows it to block malware, malformed packets that might
be exploiting a vulnerability and the like. So it know what to inspect
you have to specify in the rule what the traffic is, so you say it’s
on port 8008 and it’s HTTP. The problem was that for some reason this
rule had been set to use port 8008, but the traffic type was set to
passive mode FTP rather than HTTP. Once I corrected it to HTTP, it
started working.
Try putting ServerB in DMZ too and see what happen.
If it acts the same its a network issue.
If not you might have 2 different versions of code on the servers.
This sounds to me like you have special characters in your URL and they cause the overwriting of the port number, but only if the characters are recognized in the character set. Can you use a hex editor to check the URL for special characters (backspace, specifically)?
I can't solve your problem, but look for any transcoders on the path.
Send request from server C to server A.
1) wireshark at A, to see if it receives request correctly. A possible transcoder may convert host-less urls to host-ful ( GET /service/getId to GET http:// serverA:8080/service/getId), or may drop Host header etc. But if you see nothing wrong here proceed to step 2.
2) wireshark at B, to see if response is valid. Look if Content-Type is set correctly. If set correctly, and still getting manipulated try adding header Cache-Control: no-transform. Many transcoders respect that. If this also fails and can't remove any possible transcoders, viruses you may have go to step 3.
3) Just go https, it is immune to such things.
This is a feature of Apache, designed to hide parts of the HTTPresponce.
I did not see a fix immediatly, and do not have the time to look right now. I'll try to edit one in later.
If you want to try to find it, here is the link to the documentation: http://xianshield.org/guides/apache2.0guide.html
use [Ctrl] + [F] to find this statement (without qoutes) "Configure and build the Apache Server"