Git Product home page Git Product logo

binotify-soap's Introduction

Binotify SOAP Service

Service yang digunakan oleh binotify rest dan binotify app untuk proses subscription dan lainnya. Terhubung dengan database mysql.

Skema Basis Data

image
Terdapat perubahan skema di atas sebagai berikut:

  • Penambahan tabel api_key, digunakan untuk verifikasi api key dari binotify php dan binotify rest.
    Atribut:
  `id` int NOT NULL AUTO_INCREMENT,
  `services` varchar(255) NOT NULL,
  `api_key` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)

Features

Logging

Digunakan untuk memasukkan setiap request yang diterima SOAP ke database.
Usage:

  1. Add code below in your controller.
@Resource WebServiceContext wsContext;
  1. Add code below in your interface.
@Resource
  1. Add code below to log the incoming request.
// void
insertLog(wsContext, "log message", "endpoint");

API Key

Digunakan untuk verifikasi incoming request yang berkaitan dengan subscription.
Usage:

  1. Add code below before any operation in your controller.
// return boolean
verifyAPIKey(wsContext)
  1. Do step 1 and 2 in logging above (we need WebServiceContext to read http request headers).

Example for API key verification and logging:

public class CheckStatusController extends Database implements CheckStatusInterface {
    @Resource WebServiceContext wsContext; // add to your controller and interface
    @WebMethod
    public boolean getStatus() {
        if (verifyAPIKey(wsContext)) { // verify the incoming request API key
            String query = "select * from subscription where creator_id = " + creator_id + " and subscriber_id = " + subscriber_id;
            String status = "";
            try {
                ResultSet res = this.executeQuery(query);
                List<Map<String, Object>> data = getFormattedRes(res);
                if (data != null) {
                    status = (String) data.get(0).get("status");

                    // add this to log the incoming request
                    insertLog(wsContext, "Mengecek status subscription", "/subscription-status");
                }
            } catch (Exception e) {
                e.printStackTrace();
                System.out.println(e);
            }
            return status.equals("ACCEPTED");
        } else {
            return false;
        }
    }
}

Pembagian Tugas SOAP

Task NIM
Request Subscription 13520080
Check Request 13520002
Accept/Reject Request 13520161
Notifikasi E-mail 13520161

binotify-soap's People

Contributors

ranjabi avatar msyahrulsp avatar jasonk19 avatar shakespeareoverflow avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.