Transport and Listener Configuration Files
There are two transport and listener configuration files for HydraExpress Web services:
• server-transports-template.xml to define transports used by the server
• client-transports-template.xml to define transports used by the client
These files are located in the <installdir>\conf\webservices directory, and are copied to the project directory’s conf folder when a project is generated, at which time they are renamed just transports.xml and client-transports.xml, respectively. Both files define default transports, but you can add any other custom transports to them that your applications may need.
If you do wish to configure additional transports, and you want these additions to apply to all of your projects, change the files in the <installdir>\conf\webservice directory, rather than in a particular code generation directory; conversely, if the transports should be specific to an individual service, edit the files in that service’s project directory.
The file server-transports-template.xml defines the transports that are loaded into the Agent at startup for each deployed service. In general, a given transport is defined by both a transport element and a listener element. The listener element specifies the object that listens for incoming messages; the transport element specifies the object that sends messages.
The file client-transports-template.xml defines the transports available to the client for sending messages to a server. As with the server-side transport file, this generated file contains transport elements for HTTP and HTTPS, although you can add any custom transports to it that you wish. This file also contains listener elements used by the notification and solicit-response message patterns in which the client needs to listen for messages from a server.
Let’s look at both these files in more detail.
Following is the entry in server-transports-template.xml for the HTTPS transport:
<rwsf:transport name="HTTPS"
uri="http://schemas.xmlsoap.org/soap/https"
scheme="https"
default="true"
class="rwsf_webservice_transport_https.createHttpsTransport">
<rwsf:property name="connect-timeout" value="60000"/>
<rwsf:property name="submit-timeout" value="60000"/>
<rwsf:property name="reply-timeout" value="60000"/>
<rwsf:property name="delay-payload" value="false"/>
<rwsf:property name="delay-payload-timeout" value="30000"/>
<rwsf:property name="security-init-seed" value="1234567890..."/>
<rwsf:property name="ssl-quiet-shutdown" value="false"/>
<rwsf:property name="security-init-seed-type" value="string"/>
<rwsf:property name="ssl-trusted-certificates" value=""/>
</rwsf:transport>
<rwsf:listener name="HTTPS"
uri="http://schemas.xmlsoap.org/soap/listener/https"
scheme="https"
default="true"
class="rwsf_webservice_transport_https.createHttpsMessageListener">
<rwsf:property name="auto-start" value="false"/>
<!-- When host and port listener properties are absent,
they will be auto-configured to the machine’s host name
and first available port. The machine will need to be
configured for lookup on the network under its host name. -->
<rwsf:property name="host" value="localhost"
<rwsf:property name="port" value="9443"/>
<rwsf:property name="request-backlog" value="5"/>
<rwsf:property name="request-timeout" value="60000"/>
<rwsf:property name="request-buffersize" value="4096"/>
<rwsf:property name="keep-alive" value="true"/>
<rwsf:property name="ssl-quiet-shutdown" value="false"/>
<rwsf:property name="ssl-certificate"
value="${RWSF_CONF}/certs/localhost.crt"/>
<rwsf:property name="ssl-private-key"
value=${RWSF_CONF}/certs/localhost.key"/>
<rwsf:property name="security-init-seed" value="1234567890..."/>
<rwsf:property name="security-init-seed-type" value="string"/>
</rwsf:listener>
Notes:
• The name attribute is simply a label that identifies a particular transport or listener, allowing it to be selectable in the client or server at runtime.
• The class attribute points to a method in a DLL that creates an object for the transport or listener with the functionality needed to send or receive messages via that transport. In the example above, rwsf_webservice_transport_https is the library name, while HttpsMessageListener is the class name.
• The scheme value explicitly identifies the transport type. Often this could be safely derived from the uri attribute, but not necessarily.
• The default attribute indicates whether a particular element is the default transport or listener for the given scheme. This is important when the generated code is determining which transport or listener to use based only on a location, i.e. the URL provided in the soap:address location attribute of the WSDL file. The code decides which scheme to use, and then selects the default transport or listener for that scheme based on the default attributes. If more than one of the available transports or listeners has default set to true, the code takes the first one encountered.
• If the
host and
port properties in the listener are not specified or commented out, the listeners will be configured automatically as described in
“Using an Autoconfigured Listener.”