Simple Java WebService Server and Java Client Consumer.
Java WebService Server Functions:
A Loyalty Program has a MSSQL 2008 DATABASE with a TABLE NAMED [login to view URL] (CUSTOMER in english), this table has a record for every customer registered in the loyalty program. Customer earns points on every sales transaction, customers redeem their points every so often using they ID CARD.
We need a simple java web client program to connect to the remote server (where java webservice and db reside) to validate available points and/or consume (redeem) n points for a affiliate customer.
TABLE: [login to view URL]
ID or KEY = Field (NO_CLIENTE)
AVAILABLE POINTS = (PTOS_DISPONIBLES)
Each redemption transaction (redeemed points) shall be recorded in the "dbo.PUNTOS_REDIMIDOS" table.
TABLE: [login to view URL] (CUSTOMER)
===============================================================================
[dbo].[CLIENTES](
[ID_CLIENTE] [int] NOT NULL,
[NO_CLIENTE] [nchar](12) NOT NULL,
[NO_TARJETA] [nchar](12) NOT NULL,
[NOMBRE] [nchar](20) NOT NULL,
[APELLIDOS] [nchar](20) NOT NULL,
[DIRECCION] [nchar](60) NOT NULL,
[ID_SECTOR] [int] NOT NULL,
[TELEFONO] [nchar](15) NULL,
[CELULAR] [nchar](15) NULL,
[ID_GENERO] [int] NOT NULL,
[ID_ESTADO_CIVIL] [int] NOT NULL,
[CORREO_E] [nchar](40) NULL,
[ID_TIENDA] [int] NOT NULL,
[ID_OCUPACION] [int] NOT NULL,
[ID_NIVEL_EDUCACION] [int] NOT NULL,
[FECHA_NACIMIENTO] [date] NOT NULL,
[FECHA_AFILIACION] [date] NOT NULL,
[TOTAL_PTOS_GANADOS] [int] NOT NULL,
[TOTAL_PTOS_REDIMIDOS] [int] NOT NULL,
[TOTAL_PTOS_VENCIDOS] [int] NOT NULL,
[TOTAL_COMPRAS] [decimal](12, 2) NOT NULL,
[CANTIDAD_VISITAS] [int] NOT NULL,
[FECHA_ULT_COMPRA] [date] NULL,
[PTOS_GANADOS] [int] NOT NULL,
[PTOS_REDIMIDOS] [int] NOT NULL,
[PTOS_VENCIDOS] [int] NOT NULL,
[PTOS_DISPONIBLES] [int] NOT NULL,
[COMPRAS] [decimal](12, 2) NOT NULL,
[FECHA_ULT_REDENCION] [date] NULL,
[USUARIO] [nchar](10) NOT NULL,
[FECHAHORA] [datetime] NOT NULL,
[INACTIVO] [char](1) NULL,
[EMPLEADO] [char](1) NULL)
===============================================================================
[dbo].[PUNTOS_REDIMIDOS](
[NO_CLIENTE] [nchar](12) NOT NULL,
[ID_TIENDA] [int] NOT NULL,
[ID_TERMINAL] [int] NOT NULL,
[TRANSACCION] [int] NOT NULL,
[FECHA] [date] NOT NULL,
[PUNTOS] [int] NOT NULL,
[PERIODO] [char](4) NOT NULL,
[USUARIO] [nchar](10) NOT NULL,
[FECHAHORA] [datetime] NOT NULL,
CONSTRAINT [PK_REDENCION_1] PRIMARY KEY CLUSTERED
(
[NO_CLIENTE] ASC,
[ID_TIENDA] ASC,
[ID_TERMINAL] ASC,
[TRANSACCION] ASC,
[FECHA] ASC
)
===============================================================================
REDEEM PROCEDURE
==================
JAVA WEB CLIENT WILL SEND (Customer Number (NO_CLIENTE), Store ID (TIENDA_ID), Pos Number
(ID_TERMINAL), Transaction Number (TRANSACTION), Amount of Points to REDEEM and the JAVA WEBSERVICE will validate information and available points agains table [login to view URL] (field PTOS_DISPONIBLES). If OK, the WEBSERVE will update the available points (field PTOS_DISPONIBLES) and registered the amount of redeem points in (dbo.PUNTOS_REDIMIDOS) table, it also will return OK to the JAVA WEBSERVICE CLIENT.
CONSULTING PROCEDURE
======================
JAVA WEB CLIENT WILL SEND (Customer Number(NO_CLIENTE)) and the JAVA WEBSERVICE will return back the available points to the JAVA WEBSERVICE CLIENT.
JAVA WEBSERVICE PROGRAM must run as a WINDOWS SERVICE in the remote server where the database reside.
JAVA CLIENT COULD USE AXIS or other implementations.
Thanks