วันอังคารที่ 16 ตุลาคม พ.ศ. 2561

week 10 How to Create Web Service

Step By Step

Tools and Library
1. Python Language
2. Visual Code
3. Pip
4. Git
5. Heroku
6. Flask
7. Zeep
8. Spyne
9. lxml
10. gunicorn

How to install Tools
1. Download Python and install Python
2. install pip
3. Download Git and pip Install git
4. Download Heroku desktop and use comand of heroku for deploy
5. Download Visual Code
6. pip install flask
7. pip install zeep
8. pip install spyne
9. pip install lxml
10. pip install gunicorn

How to Create Basic Web Service (Server)
1. Create Folder Folder name SoapServer
2. Create file name manage.py
3. in file manage.py (จัดการ Port, IP, Path ต่างๆ)


4. Create Folder App
5. Create 2 file flasked.py and spyned.py
6. in file flask.py (สร้าง Server)


7. in file spyned.py (สร้าง Service ต่างๆ)
import library


all 


create Service name HelloWorldService


create Input Out Put of Service


How to Create Basic Web Service (Client)
1. create file soapClinent.py
2. in fil soapClinent.py


Run and Test Program
1. Run Server open cmd(Window) and run python manage.py


2. Open Browser and connect to http://127.0.0.1:8000/soapAPI1/?wsdl

total

 in type


3. Run Client open cmd(Window) and run python soapClient.py


How Deploy to Heroku
1. create file Procfile
2. in Procfile
   

3. open cmd(Window) run pip freeze > requirements.txt if you finish you will see


4. open cmd(Window) run command followed
5. git add .
6. git commit -m "first Commit"
7. open browser for create repository in Heroku



8. in cmd run heroku login 
9. enter your email and password
10. run heroku git:remote -a soapservicetest
11. git push heroku master
12. Finish Basic WebService






ไม่มีความคิดเห็น:

แสดงความคิดเห็น