How to Create and Register A Custom SstTransport for A Secure Web Service
Below is a workspace which will register a custom httpsl configuration for a specific web service. The configuration is created and registered with SstTransport. Then the registry entry is mapped to a specific service URL in SstWSContainer's configuration.
You can set a breakpoint in SstWSConfiguration>>transportSchemeFor: to see how it is looked up.
The URL for the service is determined from the wsdl binding soap address:
<service name="MyService">
<port binding="tns:MySoapBinding" name="MyPort">
</port>
This is the unique key you should start with to create your key which will map your configuration to the web service.
The method
SstWSContainerConfiguration>>transportSchemeFor: uses only the "https://my-server:my-port" as the lookup key into its configuration mappings table. So given the above service address, the lookup key should be:
https://my-server:8888.
| config |
"The SstTransport class contains a registry of configurations to use when sending/receiving messages.
Step 1 is to create a configuration for thef set of ssl keys you will be using.
Start with the httpsl light transport configuration -- used by clients-- as a template: "
config := SstHttpsCommunications lightTransportConfiguration copy.
"Modify the security configuration to use the appropriate keys for your web service"
(config securityConfiguration)
certificateFilename: 'vast_client2.pem';
privateKeyFilename: 'vast_client2_key.pem';
verify: SciSslConstants::SSL_VERIFY_PEER |
SciSslConstants ::SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
verifyDepth: 1;
caPath: ' ';
caFile: 'vast_ca2.pem'.
"Change the name of the identifier from httpsl to a unique name"
config transportIdentifier: 'httpslForMyService'.
"For client only you may only need to register httpslForMyService as reachable by https rather than mutually reachable"
SstTransport
register: config
mutuallyReachableBy: (Set
with: config transportIdentifier
with: SstHttpsCommunications lightTransportConfiguration transportIdentifier).
"Now Map the url's for the different services to the transport scheme for that service in the container configuration "
"The lookup for the mapping uses what is called the urlAddressString rather than the whole https address for the service
urlAddressString := url sstAsUrl in method SstWSContainerConfiguration>>transortSchemeFor: "
( SstWSContainer containerNamed: ( SciSocketManager default getHostName)) configuration
Last modified date: 08/16/2019