Hi I am trying to have both http & https protocols available in Spring Boot web service. I was following this tutorial :https://drissamri.be/blog/java/enable-https-in-spring-boot/
HTTPS Post method works, but http doesn't. I test it via SoapUI and it throws HTTP status 405 - Method not allowed
.
This is how request/response method looks in code:
private static final String NAMESPACE_URI = "http://....";
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "getRequest")
@ResponsePayload
public GetResponse getRequest(@RequestPayload GetRequest request){...}
Any code snippet I should attach?
Thank you for help.
I had the same error 405 for POST requests. I found a way to fix it.
To enable both https and http with GET and POST I had to add the following to a @Configuration class instead of the TomcatEmbeddedServletContainerFactory as described in the post:
Hope this helps for people will have the same problem in future.
After fiddling with with multiple tutorials, answer is to follow official guide...
http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#howto-enable-multiple-connectors-in-tomcat
UPDATE:
configuration: