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.
Related
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 try to implement a load test in jmeter for a web service written in java (Spring MVC+Hibernate). The server is RESTFull and a client (in angularjs) communicates with server.
I want to dump HTTP request with jmeter HTTP Request recorder the same as a tutorial on jmeter user guides.
The problem is that I keep on getting a 415 Http error while using jmeter as proxy on web browser. So the webpage is faced with an error while trying to post data and fails.
HTTP Status Code 415 stands for Unsupported Media Type, it means that Content-Type header is either incorrect or missing.
JMeter shouldn't be removing this header so my expectation is that either there is a problem with your application or with JMeter itself.
Try recording your test scenario using i.e. JMeter Chrome Extension and if it will be successful - please raise a ticket in JMeter Bugzilla
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 !!!
I'm writing a server side app in Java using the HttpCore library.
I have an HttpRequest and I'm trying to get the postdata sent from a form. The problem is- when I use request.getEntity() it returns a null object, even though when I look through HTTPFox on what kind of request I'm sending the post data is clearly there.
What am I doing wrong?
There seems to be some confusion. You are sending requests from a browser to the server. The server is likely using the servlet API. There you handle requests using the doPost(..) method of an HttpServlet. You have an HttpServletRequest from which you can get the parameters - request.getParameter("paramName")
HttpCore on the other hand is used to make requests, not to handle requests. It is used as an http client (in the role of the browser).