The following example sends a username token to the service and encrypts it with the server's X.509 certificate:
web_service_set_security(
SECURITY_TOKEN, "Type=X509","LogicalName=serviceCert", "StoreName=My", "IDType=SubjectName", "IDValue=CN=serviceCert", "StoreLocation=CurrentUser", "Add=True",
SECURITY_TOKEN, "Type=USERNAME","LogicalName=myUser", "UserName=John", "Password=1234", "PasswordOptions=SendPlainText", "Add=True",
ENCRYPTED_DATA, "UseToken=serviceCert", "TargetToken=myUser",
LAST);
The UseToken and TargetToken properties indicate which token to use and which to encrypt. Their values reference the LogicalName property of the tokens.
Back to top