Skip Headers
Oracle® Retail Allocation Operations Guide
Release 14.1
E57847-01
  Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
 
Next
Next
 

8 Allocation ReSTful Web Service Implementation

This chapter gives an overview about the Allocation ReSTful Web Service Implementation and API designs used in the Allocation environment. Retailers can access back-end functionality in Retail applications by calling the applications' ReSTful Web Services.

Refer to http://www.oracle.com/technetwork/articles/javase/index-137171.html to learn more about ReST as an architectural style applied to building Web services.

Introduction

The Allocation ReSTful Web Services are built based upon a mobile application point of view as defined by Oracle Retail. The services are designed to support the mobile application functionality defined in this point of view.

Figure 8-1 Allocation ReSTful Web Services


Other Uses

The main objective of the ReSTful Web Services is to support the Merchandising Mobile Application; therefore, some of the services functionalities may not be useful for general use. The services can be used as is for client's custom mobile application. The ReSTful Web Services Java code cannot be customized, but the MBL PL/SQL functions and object types can be customized for client use. In addition you can use the RSE tool to create your own custom services in place of the ReSTful Web Services.

Using ReSTful Web Service During Batch Window

The services should not be used during the restricted batch window.

Common Characteristics of Retail Application ReSTful Web Services

This section covers the following:

Deployment

A Retail application packages its ReST services as part of the application's Enterprise Archive (EAR) file. Specifically, those services are packaged as a Web Archive (WAR) within the EAR. Installation of the ReST Web Services is therefore done by default.

Security

Services are secured using J2EE-based security model.

  • Realm-based User Authentication - This verifies users through an underlying realm. The username and password is passed using Http Basic authentication.

  • Role-based Authorization - This assigns users to roles, which in turn are granted or restricted access to resources/services. The authorization of ReSTful Web Services is static and cannot be reassigned to other rules post installation. The following roles are associated with ReSTful Web Services and should be added to the Enterprise LDAP:

    ROLE-NAME PRINCIPAL-NAME
    BUYER BUYER_JOB
    ALLOCATOR ALLOCATOR_JOB
    ALLOCATION_MANAGER ALLOCATION_MANAGER_JOB

    All enterprise roles defined above are mapped in web.xml and weblogic.xml of the ReST Service Web application.

  • The communication between the server and client should be encrypted using one way SSL to protect sensitive information (e.g. user names and passwords). It is highly recommended that these ReST services are configured to use SSL connections in production environments.

Standard Request and Response Headers

Retail application ReSTful Web Services have the following standard HTTP headers:

Accept: application/xml or application/JSON
Accept-Version: 14.1 (service version number)
Accept-Language: en-US,en;q=0.8
Content-Type: application/xml or application/JSON

Depending on the type of the operation or HTTP method, the corresponding response header is updated in the Http response with the following codes:

· GET/READ : 200
· PUT/CREATE : 201 created
· POST/UPDATE : 204
· DELETE : 204

Standard Error Response

An example response payload in case of service error is depicted below:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<messagesRDOes>
<messagesRDO>
<message>REST Service Version Mismatch</message>
<messageType>ERROR</messageType>
<status>BAD_REQUEST</status>
</messagesRDO>
</messagesRDOes>
  • message: The error message - translated.

  • messageType: Value of 'ERROR' is returned.

  • status: For a bad request or error, the status is BAD_REQUEST.

  • The http error code for an error response is 400

URL Path

To access the Allocation ReSTful Web Services javadoc:

http://host:port/Allocation14

To access the Allocation ReSTful Web Services' WADL file:

http://host:port/Allocation14/services/private/application.wadl

To access the Allocation ReSTful Web Services:

http://host:port/Allocation14/services/private/<service>

Web Service APIs Process Flow

Figure 8-2 Web Service API Process Flow


List of ReSTful Web Services

This section covers the following:

Allocations

This section covers the following:

Approve

Business Overview

REST endpoint for approving an allocation.

Service Type

Post

ReST URL

/Allocations/approve

Parameter(s)

  • AllocationRDO - {"id": Value}

Returns

No content response.

Allowed Job Roles

ALLOCATOR, ALLOCATION_MANAGER

Load Recent Allocations by User

Business Overview

REST endpoint for loading recent allocations of logged in user.

Service Type

Get

ReST URL

/Allocations/recent/{records}

Parameter(s)

  • records - number of records to return

Returns

A collection of AllocationRDO

Allowed Job Roles

ALLOCATOR, ALLOCATION_MANAGER, BUYER

Load by Query

Business Overview

REST endpoint for loading allocations that satisfy the supplied criteria.

Service Type

Get

ReST URL

/Allocations?dept={dept}&class={class}&subclass={subclass}&id={id}&status={status}&allocStatus={allocStatus}&createdDate={createdDate}&createdBy={createdBy}

Parameter(s)

  • dept - department of the items within an allocation

  • class - class of the items within an allocation

  • subclass - subclass of the items within an allocaiton

  • id - comma separted allocation ids

  • status - the process status of an allocation

  • allocStatus - the status of an allocation

  • createdDate - created date of an allocation in yyyy-MM-dd format

  • createdBy - userId information of the user who created allocation

Returns

A collection of AllocationRDO

Allowed Job Roles

ALLOCATOR, ALLOCATION_MANAGER, BUYER

Load by Allocation Id

Business Overview

REST endpoint for loading allocation header based on allocation id.

Service Type

Get

ReST URL

/Allocations/{id}

Parameter(s)

  • id - allocation id

Returns

A collection of AllocationRDO

Allowed Job Roles

ALLOCATOR, ALLOCATION_MANAGER, BUYER

Load Item Location Information

Business Overview

REST endpoint for loading item location information based on supplied information.

Service Type

Get

ReST URL

/Allocations/{id}/itemloc?facetSessionId={facetSessionId}&allocType={allocType}&itemId={itemId}&whId={whId}&docType={docType}&docId={docId}&diffDescription={diffDescription}&diffTypeId={diffTypeId}

Parameter(s)

  • id - allocation id

  • facetSessionId - facet session id associated with the allocation. This id is generated from a loaded allocation.

  • allocType - type of allocation. Acceptable values: SA, FA, or FPG.

  • itemId - item id

  • whId - warehouse id associated with the item

  • docType - source type where the item is source from. Acceptable Values ( PO, ASN, OH, WHIF, BOL,TSF)

  • docId - source order number

  • diffDescription - diff description retrieved from allocation details service

  • diffTypeId - diff type id retrieved from allocatio details service

Returns

A collection of ItemLocRDO

Allowed Job Roles

ALLOCATOR, ALLOCATION_MANAGER, BUYER

Lookup Allocation Status

Business Overview

REST endpoint for looking up allocation statuses.

Service Type

Get

ReST URL

/Allocations/allocStatus

Parameter(s)

None

Returns

A collection of LookUpRDO

Allowed Job Roles

ALLOCATOR, ALLOCATION_MANAGER, BUYER

Lookup Process Status

Business Overview

REST endpoint for looking up process statuses.

Service Type

Get

ReST URL

/Allocations/status

Parameter(s)

None

Returns

A collection of LookUpRDO

Allowed Job Roles

ALLOCATOR, ALLOCATION_MANAGER, BUYER

Reserve

Business Overview

REST endpoint for reserving an allocation.

Service Type

Post

ReST URL

/Allocations/reserve

Parameter(s)

  • AllocationRDO - {"id": Value}

Returns

No content response.

Allowed Job Roles

ALLOCATOR, ALLOCATION_MANAGER

Submit

Business Overview

REST endpoint for submitting an allocation.

Service Type

Post

ReST URL

/Allocations/submit

Parameter(s)

  • AllocationRDO - {"id": Value}

Returns

No content response

Allowed Job Roles

ALLOCATOR, ALLOCATION_MANAGER

Withdraw

Business Overview

REST endpoint for withdrawing an allocation.

Service Type

Post

ReST URL

/Allocations/withdraw

Parameter(s)

  • AllocationRDO - {"id": Value}

Returns

No content response.

Allowed Job Roles

ALLOCATOR, ALLOCATION_MANAGER

MerchHierarchies

This section covers the following:

Lookup Classes by Department

Business Overview

REST endpoint for retrieving all classes under a given department.

Service Type

Get

ReST URL

/MerchHierarchies/dept/{dept}/class

Parameter(s)

dept - department id

Returns

A collection of MerchHierarchyRDO

Lookup Class

Business Overview

REST endpoint for retrieving a specific class.

Service Type

Get

ReST URL

/MerchHierarchies/dept/{dept}/class/{itemclass}

Parameter(s)

  • dept - department id

  • itemclass - item class id or item class name

Returns

A collection of MerchHierarchyRDO

Lookup All Deparments

Business Overview

REST endpoint for retrieving all departments.

Service Type

Get

ReST URL

/MerchHierarchies/dept

Parameter(s)

None

Returns

A collection of MerchHierarchyRDO

Lookup Department

Business Overview

REST endpoint for retrieving a specific department.

Service Type

Get

ReST URL

/MerchHierarchies/dept/{dept}

Parameter(s)

dept - department id or department name

Returns

A collection of MerchHierarchyRDO

Lookup Subclasses by Department and Class

Business Overview

REST endpoint for retrieving all subclasses under a given department and class.

Service Type

Get

ReST URL

/MerchHierarchies/dept/{dept}/class/{itemclass}/subclass

Parameter(s)

  • dept - department id

  • itemclass - item class id

Returns

A collection of MerchHierarchyRDO

Lookup Subclass

Business Overview

REST endpoint for retrieving specific subclass.

Service Type

Get

ReST URL

/MerchHierarchies/dept/{dept}/class/{itemclass}/subclass/{subclass}

Parameter(s)

  • dept - department id

  • itemclass - item class id

  • subclass - subclass id or subclass name

Returns

A collection of MerchHierarchyRDO