This is what I did:
create a self-signed certificate with
CN=saturn (yes, saturn is my host/machine name)
(this way, there is no need to add any Java code to take care of Host name verification)
1. On WCF side,
a. create a self-signed certificate with CN=saturn (yes, saturn is my host/machine name)
(this way, there is no need to add any Java code to take care of Host name verification)
b. create a self-hosted WCF service + TransportWithMessageCredential + UserName
expose it as
https://saturn:portnumber/nameoftheservice
EDITED: add portnumber
2. On Java side, using NETBeans,
a. export the public-key certificate from 1.a (self-signed certificate with CN=saturn)
b. import into trust keystore: glassfish-3.1.1\glassfish\domains\domain1\config\cacerts.jks
This will take care of SSL Handsake between WCF service/server side and GlassFish client side.
c. use Netbeans
IDE to wsimport WCF wsdl to have JAX-WS generated class.
d. select the Webservice Reference and right click to add User name/Password using static mode for
testing.
(this will take care of username token profile)
That's it.