Spring WS client sending HTTPS requests

I have implemented a web service that acts as both a server and a client. So there is another webservice that calls my webservice and I will forward the call to another webservice. So my webservice is acting as an intermediary. I have implemented a web service with Spring-WS and I opted for XML annotations. So there is no configuration XML file. When I act as a client and use HTTP to talk to another web service, I am returning correct results. However, I need to make HTTPS requests and I couldn't find good examples of what should be implemented in the Spring-WS client. So if I need to implement this, where do I start with Spring-WS? Are there any good examples / sources I can refer to?

Also, I need to verify that the certificate from the server is valid. Is there a mechanism in Spring to check if the certificate I receive from the server is correct?

+3


source to share


1 answer


Switching to HTTPS on the client side should be as easy as switching to the https scheme in your URL. WebServiceTemplate

Supports HTTPS by default .



As far as certificate validation is concerned, this is not done with Spring-WS, but rather with a core HTTP connection library. If, for example, you are using HTTP components ( HttpComponentsMessageSender

which I recommend using for example ), this page seems relevant.

+3


source







All Articles