Using JDeveloper to Develop and Deploy Asynchronous Web Services Developing an Asynchronous Web Service

Developing Asynchronous Web Services 4-5 The callback client sends the MessageId corresponding to the initial request in the relatesToId field in the WS-Addressing header. If additional data is required by the callback service to process the response, clients can perform one of the following tasks: ■ Clients can send the data as a reference parameter in the ReplyTo field. Asynchronous Web services return all reference parameters with the response, so the callback service will be able to access the information. ■ If sending the data as part of the asynchronous request message is not practical, then the client can save the MessageID and data required to the local data store.

4.2 Using JDeveloper to Develop and Deploy Asynchronous Web Services

You can develop and deploy asynchronous Web service methods for an ADF Business Component quickly and easily. For complete details, see How to Generate Asynchronous Web Service Methods in Developer’s Guide for Oracle Application Development Framework. The following sections describe in more detail how an asynchronous Web service is implemented. In some cases, the information is provided for informational purposes only.

4.3 Developing an Asynchronous Web Service

A JAX-WS Web service can be declared an asynchronous Web service using the following annotation: oracle.webservices.annotations.async.AsyncWebService. The following provides a very simple POJO example of an asynchronous Web service: import oracle.webservices.annotations.PortableWebService import oracle.webservices.annotations.async.AsyncWebService PortableWebService AsyncWebService public class HelloService { public String helloString name { return “Hi “ + name; } } The generated WSDL for the asynchronous Web service contains two one-way operations defined as two portTypes: one for the asynchronous operation and one for the callback operation. For example: wsdl:portType name=HelloService wsdl:operation name=hello wsdl:input message=tns:helloInput xmlns:ns1=http:www.w3.org200605addressingwsdl ns1:Action= wsdl:operation wsdl:portType wsdl:portType name=HelloServiceResponse wsdl:operation name=helloResponse wsdl:input message=tns:helloOutput xmlns:ns1=http:www.w3.org200605addressingwsdl ns1:Action= wsdl:operation 4-6 Concepts Guide for Oracle Infrastructure Web Services wsdl:portType Optionally, you can define a system user to secure access to the asynchronous Web service using the systemUser argument. If not specified, this value defaults to OracleSystemUser. For example: AsyncWebServicesystemUser=ABCIncSystemUser’ For more information about securing the request and response queues used by asynchronous Web services, Section 4.4.4, Securing the Request and Response Queues .

4.4 Creating the Request and Response Queues