Reg. No.: AA1893
The Currency Converter Web service is made using java and it doesn't need database sevices as it reads the json file using a URL. The client application is created using flask framework as a web application.
Server is created using java and the server reads currency data using a url there is no need for placing a .json file or a creating database. There are 2 ways to run the server.
- Import
currency_server\project_files
folder as a project. - Add
json-simple-1.1.1.jar
as a dependency of the project structure > modules. - Run Server.java file and server will be hosted on
http://localhost:8888/currency_server
- Get the
currency_server.war
fromcurrency_server
folder. - Install
Apache Tomcat server
(7.0.47). - Add
json-simple-1.1.1.jar
file to thelib\
folder of the Tomcat server. - Deploy the
war
file using anApache Tomcat server
. (Tested on Apache Tomcat 7.0.47) - You can visit WSDL of the site by using
http://localhost:8080/currency_server/services/ServerImpl?wsdl
. (URL could change depending on the configuration settings)
Full WSDL output looks like this, High Quality Image: https://images2.imgbox.com/55/69/eWQMIzPi_o.png
Client Application is made with flask framework.
- Create a virtual environment and install the required modules using the requirements.txt file.
$ python -m venv venv
$ .\venv\Scripts\Activate.ps1
$ pip install -r .\requirements.txt
-
Copy all the client directories and files to your project directory.
-
Update the
URL
global variable to your WSDL url. (URL may change depending on the method you are using to host the server.) -
After that run
run.py
file usingpython3 run.py
.(Make sure you are still inside the virtual environment.)
There are 2 web services in the web server.
1. convert(amountInSourceCurrency: xsd:float, sourceCurrency: xsd:string, targetCurrency: xsd:string) -> convertReturn: xsd:float
2. currencyData() -> currencyDataReturn: xsd:string
First function is convert()
which takes amountInSourceCurrency
, sourceCurrency
and, targetCurrency
and returns the value of the target currency as a float value.
Second Function does not take any extra parameters and it returns a string of comma-separated currency names.
Web Application looks like this, High Quality Image: https://i.imgur.com/xCq6ull.png
Github : https://github.com/re4nightwing/SOAP_WebClient_JavaServer