1

I'm implementing a proxy towards a webservice in Java EE and I've generated stubs from a WSDL for the webservice. However, in the user manual for the webservice all the examples are in C#, and the manual says you have to set the ClientCredentials property on the auto-generated proxystub in order to authenticate the user to the webservice.

Since that class is C# specific, do you guys have any suggestions on how to do it in Java? I've looked through the autogenerated code but I couldn't find any other properties that look like they are related to authentication. I appriciate any input on this since the people behind the webservice aren't very helpfull..

cakism
  • 255
  • 3
  • 10

1 Answers1

1

check out this answer Connect to a https site with a given p12 certificate

the HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory()); is the key. if after this point you open a secure connection to a wsdl service it will uses the credentials that you set up.

Community
  • 1
  • 1
Batavia
  • 2,497
  • 14
  • 16