Web Services Reference for Oracle Self-Service E-Billing > Customizing RESTful Resources >

About Customizing Localization Values


This topic describes additional information about customizing localization using Web services with Oracle Self-Service E-Billing.

Customizing the Locale

The locale values of the request and response are specified in the HTML header. In service requests, the locale can be retrieved from the Accept-language attribute. Oracle Self-Service E-Billing supports one acceptable language for each request. The following XML shows an example of a request using the Accept-language attribute:

POST /rsclient/webservice.action HTTP/1.1

Host: myhost.example.com:7001

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.7) Gecko/20100101 Firefox/10.0.7

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: en-US,en;q=0.5

Accept-Encoding: gzip, deflate

In the service responses, the locale value is in the Content-Language attribute, as shown:

HTTP/1.1 200ok

Date: Wed, 05 Sep 2012 22:14:15 GMT

Content_Length:533

Content-Type:application/xhtml+xml

Content-Language: en-US

X-Powered-By:Servlet/2.5 JSP/2.1

Customizing the Date Format

For a particular locale, when parsing date values in requests or output date values in responses, the pattern used to convert a string to or from the date value is specified in an attribute of the date tag element. For example:

<Call_date pattern="MM/dd/yyyy">09/15/2012</Call_date>

This date attribute is included in all responses of GET requests.

For all POST and PUT resources, the Oracle Self-Service E-Billing server requires the XML payload to specify date pattern in the tag element attribute. The server code can then parse the information accordingly. In the following input XML example, the Accept-Language element is es_ES in the request header:

<paymentAccountActivity>

<billerId>BS1</billerId>

<accountNumber>7836380B2B1</accountNumber>

<currBalance>786,00</currBalance>

<lastPaymentReceivedAmount>120,00</lastPaymentReceivedAmount>

<lastPaymentReceivedDate pattern="dd/MM/yyyy">13/08/2012</lastPaymentReceivedDate>

</paymentAccountActivity>

If the date pattern is not explicitly specified in the element attribute, then the default date pattern is used. The default date pattern for each supported locale is specified in the webservice.xma.xml file, located in the following directory:

  • UNIX. EDX_HOME/xma/config/modules/webservice
  • Windows. EDX_HOME\xma\config\moduleswebservice

In the webservice.xma.xml file, the bean DatePatternFactory includes a list of DatePattern beans. Each DatePattern bean represents a pattern for a supported locale. The locale value must match the value stored in the EDX_SYS_LANG table locale CODE column. The datePatternMap contains a map of the pattern keys and values, which lists the possible patterns that can be used for pure Date and Datetime. A pure Date or Datetime value does not include a presentation format. The key and value must be consistent with the resource bundle files that are used by the Oracle Self-Service E-Billing Web application.

Numbers and Currencies

Numbers in both requests and responses use the default pattern of the authenticated user's preferred locale. For example, the number 120.00 is displayed in locale en_US and 120,00 in the es_ES locale.

The currency information does not change when the user's locale preference changes. The currency information comes from the statement fact, and this currency information is used in the billing system for the account. The currency code that is displayed in the Web application is included as part of the XML response.

For GET business object resources, the currency code is specified in an attribute of a tag element, for example:

<disputeInfo currency="USD">

<disputeId>90007</disputeId>

<disputeRefNumber>900067</disputeRefNumber>

<accountNumber>7836380B2B1</accountNumber>

<disputeAmount>12.3</disputeAmount>

<disputeDesc> chris webservice</disputeDesc>

<disputeReason>1</disputeReason>

<disputeStatus>open</disputeStatus>

</disputeInfo>

For GET report resources, the currency code is specified in the <Header> tag for each column that requires the currency, for example:

<header>

<Total>USD</Total>

</header>

Web Services Reference for Oracle Self-Service E-Billing Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.