The class rwsf::TransportManager manages the use of transports and listeners for a message. It is used by generated client proxies to initialize the appropriate transport or listener for that proxy.
If you customize or write your own client proxy, always use this class to locate and instantiate a transport or listener. For example, in the following code, the proxy make() function gets an HTTP transport through the Transport Manager.
myProxy myp = myProxy::make("http://someurl");
If you are specifying the type of transport directly instead of relying on the scheme indicated by a location url, use the method findTransport().
- Note
- The default transport files are
transports.xml for a service and client-transports.xml for a client, although you may create your own or modify the name. For more information, see the transports chapter in the Web Service Development Guide.
Returns a new listener instance based on the scheme field of the parameter url. Uses the scheme and default attributes in the transports configuration file or client transports configuration file to locate the appropriate listener.
For example, consider the listener definition below from the default transports configuration file, transports.xml:
<rwsf:listener name="MyListener"
uri="http://schemas.xmlsoap.org/soap/listener/http"
scheme="http"
default="true"
class="example_listener.createMyListener">
<rwsf:property name="auto-start" value="false"/>
<rwsf:property name="host" value="localhost"/>
<rwsf:property name="port" value="9090"/> -->
<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:listener>
Given the above listener configuration, this method will return a MyListener instance by default for all urls with an "http" scheme, i.e. http://somehost:someport/somepath. If the attribute default is set to false instead of true, then this listener will never be returned by this method. If more than one listener with the same scheme and default set to true exists, then the method will use the one that occurs first in the file.
| rwsf::Transport rwsf::TransportManager::findTransportByUrl |
( |
const std::string & | url | ) |
|
|
static |
Returns a new transport instance based on the scheme field of the parameter url. Uses the scheme and default attributes in the transports configuration file or client transports configuration file to locate the appropriate transport.
For example, consider the the transport definition below from the default configuration file, transports.xml:
<rwsf:transport name="MyTransport"
uri="http://schemas.xmlsoap.org/soap/http"
scheme="http"
default="true"
class="example_transport.createMyTransport">
<rwsf:property name="connect-timeout" value="60000"/>
<rwsf:property name="submit-timeout" value="60000"/>
<rwsf:property name="reply-timeout" value="60000"/>
</rwsf:transport>
For the configuration above, this method returns a MyTransport instance by default for all urls with an "http" scheme, i.e. http://somehost:someport/somepath. If the attribute default is set to false instead of true, then this transport will never be returned by this method. If more than one transport with the same scheme and default set to true exists, then the method will use the one that occurs first in the file.