Code Monkey home page Code Monkey logo

vertx-soap-consumer's Introduction

vertx-soap-consumer

Sample application built in Vertx to consume SOAP or WCF based services.

Getting Started

Git clone the project on your local machine and add it to your workspace.

Prerequisites

For runnning this, you will need

  • Java 1.8
  • Gradle support - In Eclipse editor, goto help -> eclipse marketplace -> search for buildship (buildship gradle integration) and install it.
  • Axis 2 - Axis 2 library to generate java classes from WSDL files (http://axis.apache.org/axis2/java/core/).

Brief

This application consumes a publicly available SOAP/WCF service: http://www.webservicex.net/geoipservice.asmx and Vertx is used to provide a rest API which will consume SOAP/WCF service and returns the response.

  • VertxSoapLauncher -> The starting point of the application. It is used to deploy the AppVerticle.
  • AppVerticle -> Main verticle which sets the configurations, routers, HttpServer etc for the Vertx.
  • GeoIPSoapHandler -> Rest Handler which receives the input, calls the SOAP service and returns the Json response.

Execute blocking is used here along with the Async SOAP handlers.

Running the app

For running the app, (IDE used here is Eclipse)

  • Open appConfig.json file and set the "Port" as per your choice. No need to change other values.
  • Once, changes are done in appConfig.json, right click on the project("vertx-soap-consumer"),
    select "Run As" -> "Run Configurations". Set:
    • Main class: com.vertx.soap.launcher.VertxSoapLauncher
    • Program arguments:
      run com.vertx.soap.verticle.AppVerticle -conf ../vertx-soap-consumer/src/main/resources/appConfig.json
    • VM arguments: -Dlogback.configurationFile=file:../vertx-soap-consumer/src/main/resources/logback.xml After setting the variables, click "Run".
  • If app starts successfull, goto http://localhost:8080/. Status json {"status":"Ok"} will be served as response.
  • To call the SOAP/WCF service, do
    GET http://localhost:8080/vertx-soap/v1/geoip/69.89.31.226
    Content-Type: application/json
  • Response would be:
{
  "code": 200,
  "message": "Success",
  "hasError": false,
  "data": {
    "returnCode": 1,
    "ipspecified": true,
    "returnCodeDetailsSpecified": true,
    "returnCodeDetails": "Success",
    "countryNameSpecified": true,
    "countryName": "United States",
    "countryCodeSpecified": true,
    "countryCode": "USA",
    "ip": "69.89.31.226"
  }
}

Built With

  • Vertx - The web framework used
  • Axis2 - Auto code generation using WSDL
  • Gradle - Dependency Management

vertx-soap-consumer's People

Contributors

superswanz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  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.