The Extended Web Services WAP Push Web Service allows for the sending of messages, which are rendered as WAP Push messages by the addressee’s terminal. The content of the message is coded as a PAP message. It also provides an asynchronous notification mechanism for delivery status.
The payload of a WAP Push message must adhere to the following:
See http://www.openmobilealliance.org/tech/affiliates/wap/wapindex.html for links to the specifications.
The payload is sent as a SOAP attachment.
The PushMessage interface and service use the namespaces:
The PushMessageNotification interface and service use the namespaces:
The data types are defined in the namespace:
In addition, Extended Web Services WAP Push uses definitions common for all Extended Web Services interfaces:
The endpoint for the PushMessage interface is: http://<host:port>/ews/push_message/PushMessage
Where host and port depend on the Oracle Communications Services Gatekeeper deployment.
The following diagram shows the general message sequence for sending a WAP Push message from an Extended Web Services WAP Push application to the network. In this message sequence the application also receives a notification from the network indicating the delivery status of the WAP Push message, that is that the message has been read The interaction between the network and Oracle Communications Services Gatekeeper is illustrated in a protocol-agnostic manner. The exact operations and sequences depend on which network protocol is being used.
Note: | Zero or more resultNotificationmesages are sent to the application, depending on parameters provided in the initial SendPushMessage request. |
The following data structures are used in the Extended Web Services WAP Push Web Service.
Defines the response that the Oracle Communications Services Gatekeeper returns from a sendPushMessage
operation.
The ResponseResult allows the server to specify a code for the outcome of sending the push message. See ResponseResult structure
|
|||
Defines the result element in the PushResponse
structure, which is used in the response returned from a sendPushMessage
operation.
Possible status codes are listed in Table 6-1.
|
|||
Table 6-1 Outcome status codes
Defines the values for the replacePushId
parameter in the sendPushMessage
operation. This parameter is used to replace an existing message based on a given push ID. This parameter is ignored if it is set to NULL.
Defines the values for the messageState
parameter in a resultMessageNotification
.
The following describes the interfaces and operations that are available in the Extended Web Services WAP Push Web Service.
Operations to send, or to manipulate previously sent, WAP Push messages.
Sends a WAP Push message. The message Content Entity (the payload) is provided as a SOAP attachment in MIME format. The Content Entity is a MIME body part containing the content to be sent to the wireless device. The content type is not defined, and can be any type as long as it can be described by MIME. The Content Entity is included only in the push submission and is not included in any other operation request or response.
The presence of this parameter indicates that the client is requesting that this message replace one previously submitted, but still pending push message.
|
|||
The document/literal WSDL representation of the PushMessage interface can be retrieved from the Web Services endpoint.
The document/literal WSDL representation of the PushMessageNotification interface can be downloaded from
http://<host>:<port>/ews/push_message/wsdls/ews_common_types.xsd
http://<host>:<port>/ews/push_message/wsdls/ews_push_message_notification_interface.wsdl
http://<host>:<port>/ews/push_message/wsdls/ews_push_message_notification_service.wsdl
http://<host>:<port>/ews/push_message/wsdls/ews_push_message_types.xsd
Where host and port are depending on the Oracle Communications Services Gatekeeper deployment.
// Add handlers for MIME types needed for WAP MIME-types
MailcapCommandMap mc = (MailcapCommandMap) CommandMap.getDefaultCommandMap();
mc.addMailcap("text/vnd.wap.si;;x-java-content-handler=com.sun.mail.handlers.text_xml");
CommandMap.setDefaultCommandMap(mc);
// Create a MIME-message where with the actual content of the WAP Push message.
InternetHeaders headers = new InternetHeaders();
headers.addHeader("Content-type", "text/plain; charset=UTF-8");
headers.addHeader("Content-Id", "mytext");
byte[] bytes = "Test message".getBytes();
MimeBodyPart mimeMessage = new MimeBodyPart(headers, bytes);
// Create PushMessage with only the manadatory parameters
// SendPushMessage is provided in the stubs generated from the WSDL.
SendPushMessage sendPushMessage = new SendPushMessage();
String [] destinationAddresses = {"wappush=461/type=user@ppg.o.se"};
sendPushMessage.setDestinationAddresses(destinationAddresses);
// Create “unique” pushId, using a combination of timestamp and domain.
sendPushMessage.setPushId(System.currentTimeMillis() + "@wlng.bea.com");
// ReplaceMethod is provided by the stubs generated from the WSDL.
sendPushMessage.setReplaceMethod(ReplaceMethod.pendingOnly);
// Defined by the operator/service provider contractual agreement
sendPushMessage.setServiceCode(”Service Code xxx”);
// Defined by the operator/service provider contractual agreement
sendPushMessage.setRequesterID(”Requester ID xxx”);
// Endpoint to send notifications to. Implemented on the application side.
String notificationEndpoint = "http://localhost:80/services/PushMessageNotification";
sendPushMessage.setResultNotificationEndpoint(new URI(notificationEndpoint));
// Send the WAP Push message
PushMessageService pushMessageService = null;
// Define the endpoint of the WAP Push Web Service
String endpoint = "http://localhost:8001/ews/push_message/PushMessage?WSDL";
try {
// Instantiate an representation of the Web Service from the generated stubs.
pushMessageService = new PushMessageService_Impl(endpoint);
} catch (ServiceException e) {
e.printStackTrace();
throw e;
}
PushMessage pushMessage = null;
try {
// Get the Web Service interface to operate on.
pushMessage = pushMessageService.getPushMessage();
} catch (ServiceException e) {
e.printStackTrace();
throw e;
}
SendPushMessageResponse sendPushMessageResponse = null;
try {
// Send the WAP Push message.
sendPushMessageResponse = pushMessage.sendPushMessage(sendPushMessage);
} catch (RemoteException e) {
e.printStackTrace();
throw e;
} catch (PolicyException e) {
e.printStackTrace();
throw e;
} catch (com.bea.wlcp.wlng.schema.ews.common.ServiceException e) {
e.printStackTrace();
throw e;
}
// Assign the pushId provided in the in the response to a local variable.
String pushId = sendPushMessageResponse.getPushId();