Postman is not able to call the rest controller defined in controller package and gets 404 in response even after the springboot application is started and server is up at port 8080.
http://localhost:8080/api/product gives 404 from postman.
i tried 127.0.0.1 and network IP address well but no success.
have you changed HTTP request method on postman?
you also can try use one endpoint for each request method for example:
#PostMapping(value="/add")
and your POST request end point should be:
http://localhost:8080/api/product/add
Related
I am running an SpringBoot application and I have a controller which defines Rest Api and accepts a request by a list of ids. Normally it works fine but if number of ids gets bigger, then I receive http 503. Interesting thing is that I cannot see any logs that my request was received by controller as well. Therefore I am not able to understand what is happening. Do you have any idea what can be worth to check ?
503 is a error code, which means service or url or controller, that you are requested is not running/available, make sure your jar file is running and also make sure the url you requested is valid. since service is not available you cant see any logs or error messages. because your controller dint receive any request yet.
The 503 error indicate that the server is not ready to handle the request.
There are some limitations for transferring data through URL , basically the length of the URL
In general the limit was 2047 chars and it is different for different browsers
503 means Service Unavailable.
I think something is wrong with your request.
You can try to add a custom OncePerRequestFilter and log your HTTP Request.
Is there a possibility to instruct Swagger not to send the Hypertext Transfer Protocol (http) in front of a POST or GET request ?
As you can see on the screenshot, the Request URL is using http protocol
The reason of my question is that the POST request from swagger-ui is not arriving on the server. An undocumented response is returned from the server although the response code is 200. This can be seen on the second screenshot.
When disabling https on the reverse proxy, the request arrives on the server correctly and response code is 200.
In my java spring application, I've implemented the proposed solution which are described in https://springdoc.org/faq.html : How can I deploy springdoc-openapi-ui behind a reverse proxy?
But it didn't solve my proble.
I managed to find how to tell swagger to make the request when pressing the excecute button
In application.yaml, you have to add the following:
swagger:
url: "https://www.example.com.com/aa"
I have a Java application, hosted on Weblogic, which sends a REST POST request to a mock service hosted in SoapUI running on the same server.
The application gets as far as sending the request to the mock service via Spring's RestTemplate class before failing with a "413 FULL head" exception (org.springframework.web.client.HttpClientErrorException).
I have a Groovy script running on SoapUI which should log the headers that the request includes. If I send a POST request to the mock service from within SoapUI itself, the headers are printed by the script successfully. When the Java application sends a (failed) request, no headers are printed. This would would imply that the request is failing before the script is executed.
I am not sure how else I can identify what headers the POST request includes.
Looking on here, it seems like a lot of other times this issue has been reported is when using GET requests. I am definitely using a POST for this request.
Java: 1.7.0_02
Spring: 4.1.7
SoapUI: 5.2.1
Weblogic: 10.3.6.0
Thanks in advance for any assistance.
I used the TCP/IP Monitor in Eclipse to find that the "Accept-Charset" HTTP header included a large amount of data.
This was fixed by setting the writeAcceptCharset property on the StringHttpMessageConverter which was used by the Spring RestTemplate object.
The issue and solution is described here: https://jira.spring.io/browse/SPR-7316.
I am able to hit a rest service successfully and get the response properly when I use REST client and Junit test case. But, however,when I try to hit the same rest service via IE browser, I am getting some junk/jumbled/encoded response from the rest service.I have used wireshark tool to investigate.
When I try to access the rest service via browser, the following headers are additionally added by the browser
accept-encoding=gzip, Content-Encoding=gzip
The above headers are not added when I try using REST client or Junit test case.
I suspect that the above headers are the root cause for getting encoded response. If my assumption is true, is there any way to get rid of those headers?
I have already tried with the following, but not working:
'accept-encoding': 'gzip;q=0,deflate,sdch'
'accept-encoding: identity'
Any ideas?
I have created a web-service that uses basic authentication in JDeveloper 11.1.1.4.
When i test my application using a client application is runs correctly so i know that the authentication mechanism has no problems.
How can i pass authentication info into the HTTP Analyzer by right clicking on Webservices and selecting Test Web Service?
I have tried to pass credentials through SOAP Headers > :WS-Security:Header like below but is not working
I have also tried to pass authentication through Credentials option like shown below
In both cases i get this error 500 HTTP Analyzer Server Error The server sent HTTP status code 401: Unauthorized: .....
How can i get through this?
Thanks
UPDATE
I also tried to pass Authentication option to Request HTTP Headers but get the error message :
Error 403--Forbidden
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.4.4 403 Forbidden
The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.
If you're using Basic authentication, all you need is set request header Authorization. Value of this header: prefix Basic, one space, Base64 encoded string with usrname:password, so your header for Aladin:sesam open should be like this: Basic QWxhZGluOnNlc2FtIG9wZW4=.
On screenshot i see section Request HTTP headers, add Authorization header to it.
I am aware that this is an old post , but this may benefit those who run into this issue.
I am using Jdeveloper 11.1.2. I have secured the JAX-RPC web service (created by exposing PL/SQL poackage) using basic authentication. I attached the security policy: "Auth.xml" using the wizard.
I was able to test this using HTTP Analyzer. I just passed the user credentials in the SOAP Headers as shown below and it worked fine for me.(I also passed invalid creds and no creds to see if the security works as expected.)
Hope this helps !!!