Publishing the Asynchronous Response Endpoint Configuring Asynchronous Client Transport for Synchronous Operations

3-14 Programming Advanced Features of JAX-WS Web Services for Oracle WebLogic Server

3.5.1.4 Publishing the Asynchronous Response Endpoint

You can configure whether to publish the asynchronous response endpoint by passing the doPublish boolean value as an argument to AsycnClientTransportFeature when configuring the following properties: ■ Address of the asynchronous response endpoint. See Table 3–5 . ■ ReplyTo and FaultTo headers. See Table 3–6 . ■ Context path of the asynchronous response endpoint. See Table 3–7 . If doPublish is set to false, then the asynchronous response endpoint is not published automatically, but WS-Addressing headers will be added to outbound non-one-way messages. This scenario supports the following programming models: ■ Asynchronous polling with no attempt to access the Response object ■ Dispatch asynchronous polling with no attempt to access the Response object ■ Dispatch one-way invocation ■ Synchronous invocation using synchronous transport option default For all other asynchronous programming models, the availability of a asynchronous response endpoint is required and the Web service client is responsible for publishing it prior to making outbound requests if doPublish is set to false. The following example configures the asynchronous response endpoint address and publishes the asynchronous response endpoint: String responseAddress = http:localhost:7001myReliableServicemyReliableResponseEndpoint; boolean doPublish = true; AsyncClientTransportFeature asyncFeature = new AsyncClientTransportFeatureresponseAddress, doPublish; BackendService port = _service.getBackendServicePortasyncFeature;

3.5.1.5 Configuring Asynchronous Client Transport for Synchronous Operations

You can enable or disable asynchronous client transport for synchronous operations using the useAsyncWithSyncInvoke boolean flag when configuring the following properties: ■ Address of the asynchronous response endpoint. See Table 3–5 . ■ ReplyTo and FaultTo headers. See Table 3–6 . ■ Context path of the asynchronous response endpoint. See Table 3–7 . Table 3–7 Constructors for Configuring the Context Path of the Asynchronous Response Endpoint Constructor Description AsyncClientTransportFeaturejava.lang.Obj ect context Configures the context path of the asynchronous response endpoint. AsyncClientTransportFeaturejava.lang.Obj ect context, boolean useAsyncWithSyncInvoke Configures the following: ■ Context path of the asynchronous response endpoint. ■ Whether to enable asynchronous client transport for synchronous operations. For more information, see Section 3.5.1.5, Configuring Asynchronous Client Transport for Synchronous Operations . Invoking Web Services Asynchronously 3-15 The following example configures the asynchronous response endpoint address and enables use of asynchronous client transport for synchronous operations: String responseAddress = http:localhost:7001myReliableServicemyReliableResponseEndpoint; boolean useAsyncWithSyncInvoke = true; AsyncClientTransportFeature asyncFeature = new AsyncClientTransportFeatureresponseAddress, useAsyncWithSyncInvoke; BackendService port = _service.getBackendServicePortasyncFeature;

3.5.2 Developing the Asynchronous Handler Interface