Giter Club home page Giter Club logo

cxf-example's Introduction

cxf-example

Objective

  • Develop an enterprise Java application that implements RESTful and SOAP web services that is secure

  • The RESTful service will expose two methods

    • public String push(int i1, int i2);
    • which returns the status of the request to the caller as a String. The two parameters will be added to a JMS queue
    • public List list();
      • which returns a list of all the elements ever added to the queue from a database in the order added as a JSON structure
  • The SOAP service will expose the following method as operations:

    • public int gcd();
    • which returns the greatest common divisor* of the two integers at the head of the queue. These two elements will subsequently be discarded from the queue and the head replaced by the next two in line.
    • public List gcdList();
      • which returns a list of all the computed greatest common divisors from a database.
    • public int gcdSum();
      • which returns the sum of all computed greatest common divisors from a database.
  • Greatest Common Divisor (GCD) of two whole numbers is the largest whole number that's a divisor (factor) of both of them. For instance, the largest number that divides into both 20 and 16 is 4.

Prerequisite

  1. Java 8 or higher version
  2. Tomcat
  3. Apache Active MQ

Code configuration Details

  1. Checkout code
  2. application.properties - Verify and update MQ Connection proerties if needed.
  3. Application is configured to use H2 inmemory database. Code changes will be required if any other database needs to be configured.
  4. scripts.sql - holds the basic schema details needed for application to work. This script will automatically be executed at application startup for inmemory database.
  5. Current logback(logback.xml) configurations will log details only to STDOUT. Additional configurations can be done to output logs to file.

Once above details are verified/configs are done, proceed to create WAR and deploy it in tomcat.

Application URLs

After successfull deployment of app, use below steps to perform operations.

REST Interface

  1. Push Numbers API
    • HTTP Method: PUT
    • URL: http://:/cxf-example/services/rest/gcd/push/10/20
  2. Push Numbers API
    • HTTP Method:GET
    • URL: http://:/cxf-example/services/rest/gcd/numbers

SOAP Interface

GCD Service WSDL URL: http://<host>:<port>/cxf-example/services/gcdservice?wsdl For quick testing, refer to ClientConfig.java. Update Host:port in line 28 if needed. And launch it as a Java Application for checks to commence.

TODO

  1. jUnit test cases
  2. Remove ClientConfig.java

cxf-example's People

Contributors

mayankgsingh avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

aspineon

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.