Git Product home page Git Product logo

uapi-search-microservice's Introduction

Travelport uAPI Air Search Reference Implementation Java

Overview:

The reference implementation was completed in Java using the Spring Boot to consume Travelport Universal API. The workflow this implementation is showcasing is the air search. Minimum fields to complete this workflow have been done using best practices in Java, TDD, and restful web services. The implementation is meant as a starting point for anyone to consume uAPI and additional modifiers can be added for additional business cases.

Software requirements:

  1. Integrated development environment (IDE) - Eclipse Oxygen www.eclipse.org/oxygen/
  2. Dependency management - Apache Maven 3.5.2 www.maven.apache.org/download/cgi
  3. Servlet framework - Springboot version 1.5.9 www.spring.io
  4. Connection library - Apache CXF 3.2.1 www.cxf.apache.org
  5. Postman - www.getpostman.com

Credentials

  1. Application.yml are the credentials that will need to be populated before sending a request
  2. Directory location of application.yml: uAPISearch_Java\src\main\resources\application.yml
  3. The four fields to populate are: username, password, branch, and endpoint
  4. It is best practice to set these fields via environment variables

Run project

Travelport API type: uAPI (Universal API)

  • Version: 18.5
  • Schema: v_45_0
  • Workflow: Air Search
  • WSDL used for Air Search include: air_v45_0, common_v_45_0, and universal_v45_0

Eclipse

  1. Clone the project
  2. Open Eclipse and import the project into the workspace
  3. Open terminal on Eclipse: Go to Window/Show View/Terminal
  4. CD (change directory) to the root folder of the project where the pom.xml lives
  5. Run command "mvn install"
  6. Run application.java as a "Java Application"

Testing

  1. All tests are located inside src/test
  2. Run ...test.java by running as a "Junit Test"

Postman

  1. Run the Project as a Java Application

  2. Open postman and make a post request

  3. URL set to: http://localhost:8090/catalogofferings

  4. Set headers for the request with:

    • Key set to: Content-Type
    • Value set to: application/json
  5. In the "body" tab make a JSON request with the objects found in the models.

  6. You can view the request schema at http://localhost:8090/swagger-ui.html

  7. Example of a body for the request:

     {
     	"CatalogOfferingsRequestAir" : {
     	"offersPerPage" : 5,
     	"PassengerCriteria" : [
     	{
     		"value" : "ADT",
     		"number" : 1
     	}
     	],
     	"SearchCriteriaFlight" : [
     	{
     	"@type" : "SearchCriteriaFlight",
     		"departureDate" : "2018-09-22",
     		"From" : 
     		{
     			"value" : "DEN"
     		},
     		"To" : 
     		{
     			"value" : "LAX"
     		}
     	}
     	],
     	"SearchModifiersAir":
     	{
     		"@type" : "SearchModifiersAir",
     			"CarrierPreference" : 
     			{
     			"@type" : "CarrierPreference",
     				"type" : "Prohibited",
     				"carriers" : ["WN"]
     			}
     		},
     		"PseudoCityInfo" : 
     		{
     			"value" : "PCC"
     		}
     	}
     }
    
  8. Click "Send"

uapi-search-microservice's People

Contributors

rdemarco08 avatar

Watchers

James Cloos 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.