spring boot - Java WebService call fails once a RestTemplate call has been made -


i have java spring boot microservice.

in our service make java web service call in our application bind wsdl , enable make soap calls service (using java.xml.ws). works!

now need make request restful webservice using springs resttemplate make rest call service.

we added resttemplate bean:

@bean public resttemplate createresttemplate() {     return new resttemplate(); } 

and call:

resttemplate.getforobject(url, string.class); 

this works too. however, resttemplate call made in our application, subsequent webservice call fails!

it fails here (sorry can't use real names):

public servicewsdl getservicewsdlimplport() {     return (servicewsdl)super.getport(         new qname("serviceurl", "servicewsdlport"),         servicewsdl.class); } 

with exception:

caused by: com.sun.xml.ws.wsdl.parser.inaccessiblewsdlexception: 2 counts of inaccessiblewsdlexception 

detail:

javax.net.ssl.sslhandshakeexception: sun.security.validator.validatorexception: pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target 

there appears conflict between java.xml.ws , spring's resttemplate.

as workaround able manually import certificate keystore, , set 'javax.net.ssl.truststore' , 'javax.net.ssl.truststorepassword' java properties point keystore. web service error disappears, same certificate error of our resttemplate calls until manually add certificates too. given there lot of certificates add each of our environments, want avoid this workaround.

in summary, java.xml.ws call , resttemplate calls work on own. once attempt use both, java.xml.ws call instantly gives certificate errors.

any appreciated!


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -