Invoking Web Services Asynchronously 3-25
...
3.6.2.3 Configuring the Exponential Backoff
Table 3–12 defines the McFeature methods for configuring the exponential backoff
flag. This flag specifies whether the polling interval, described in Section 3.6.2.2,
Configuring the Polling Interval , will be adjusted using the exponential backoff
algorithm. In this case, if the MC Initiator does not receive a non-empty response for the time interval specified by the polling interval, the exponential backoff algorithm is
used for timing successive retransmissions by the MC Initiator, should the response not be received.
The exponential backoff algorithm specifies that successive polling intervals should increase exponentially, based on the polling interval. For example, if the polling
interval is 2 seconds, and the exponential backoff element is set, successive polling intervals if the response is not received are 2, 4, 8, 16, 32, and so on.
This value defaults to false, the same polling interval is used in successive retries; the interval does not increase exponentially.
In the following example, enables the exponential backoff flag. ...
McFeature mcFeature = new McFeature; mcFeature.setMessageIntervalP0DT36H
mcFeature.setExponentialBackofftrue; MyService port = service.getMyServicePortmcFeature;
...
3.6.2.4 Configuring MakeConnection as the Transport for Synchronous Methods
By default, synchronous methods use synchronous transport even when MakeConnection is enabled on the client. You can configure your client to use
MakeConnection as the transport for synchronous methods. In this case, MakeConnection messages are sent by the MC Initiator based on the configured
polling interval described in
Section 3.6.2.2, Configuring the Polling Interval until a
non-empty response message is received. To configure MakeConnection as the transport protocol to use for synchronous
methods, use one of the following methods:
■
When instantiating a new McFeature object, you can pass as a parameter a boolean value that specifies whether MakeConnection should be used as the
transport protocol for synchronous methods. For example:
... McFeature mcFeature = new McFeaturetrue;
MyService port = service.getMyServicePortmcFeature; ...
Table 3–12 Methods for Configuring the Exponential Backoff
Method Description
boolean isExponentialBackoff Returns a boolean value indicating whether
exponential backoff is enabled. void setExponentialBackoffboolean backoff
Set the exponential backoff flag. Valid values are true and false. This flag
defaults to false.
3-26 Programming Advanced Features of JAX-WS Web Services for Oracle WebLogic Server
■
Use the McFeature methods defined in Table 3–13
. For example: ...
McFeature mcFeature = new McFeature; mcFeature.setUseMCWithSyncInvoketrue;
MyService port = service.getMyServicePortmcFeature; ...
You can set the maximum amount of time a synchronous method will block and wait for a response using the weblogic.wsee.jaxws.JAXWSProperties.REQUEST_
TIMEOUT property. This property default to 0 indicating no timeout. For more information about setting message properties, see
Section 3.5.3, Propagating User-defined Request Context to the Response
.
3.7 Using the JAX-WS Reference Implementation