Code Monkey home page Code Monkey logo

laboratory2-apache-cxf's Introduction

Laboratory2 Apache CXF

Yandex Translator SOAP Big Web-Service using Apache CXF and Spring, having the same funtionality that Laboratory 2. Also, it uses the following WS-* specifications:

  • WS-Discovery

It includes a CXF Server and a Client to test that it's working and that it implements WS-Discovery specification.

##How to run the Server (translator-cxf-ws-server)

Enter to the directory and run the server with gradle run. Then, open the page at http://localhost:8080/api/. There, you can view all the implemented SOAP services.

You can view the Service WSDL at http://localhost:8080/api/translator?wsdl.

NOTE: The address, port and context may change when deployed to a Server.

WARNING: Don't forget to add your "application.properties" to the resource folder.

##How to test WS-Discovery (translator-cxf-ws-client) NOTE: To test it, the server has to be running on the a machine on the same LAN.

In order to test WS-Discovery implementation, you have to run the test from the client project. To do so, enter to the directory and run gradle check. A test will execute. This test search in the local network for Translator services. Then, it uses the found service to make a translation of an example phrase. If the test passes, we can ensure that the server is working and that WS-Discovery is working too. Before all this, the client downloads the .wsdl file from the server and generates the proper Java source code from it.

##How to run the Client (translator-cxf-ws-client) NOTE: To test it, the server has to be running on the same machine.

Also, the client can be run in order to do a basic SOAP request to the endpoint. It is not a test. Enter to the directory and execute gradle run. This creates a client, connects it to the Endpoint and translates an example phrase.

##About WS-Discovery

###What is it? According to Apache CXF docs, WS-Discovery is a protocol to enable dynamic discovery of services available on the local network. By default, WS-Discovery uses a UDP based multicast transport to announce new services and probe for existing services. However, it also supports a managed mode where a discovery proxy is used to reduce the amount of multicast traffic required.

What are the advantages of using it? You can publish your services on your LAN network, so clients don't need to know beforehand the URL of the services they want to use. Also, you can change the machine running the service easily without changing the clients code.

###How to Enable WS-Discovery According to Apache CXF docs, to enable CXF to send "Hello" announcements when services and endpoint are started, the cxf-services-ws-discovery-service and cxf-services-ws-discovery-api jars need to be available on the classpath. The cxf-services-ws-discovery-service jar will register a ServerLifecyleListener that will automatically publish the "Hello" messages. It will also respond to any Probe requests that match the services it has published.

laboratory2-apache-cxf's People

Contributors

ismaelrh avatar

Watchers

 avatar James Cloos avatar

Forkers

agusnt

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.