วันพุธที่ 31 ตุลาคม พ.ศ. 2561

Web Service นาย ณัฐกิจ ขัดผาบ

นาย ณัฐกิจ   ขัดผาบ  5801012610032

Server side
ข้อ ที่ 1

Service ที่ 1



1. เก็บรายชื่อไว้ใน database


2. เขียน function fetch ข้อมูลจาก database
3. เขียน service  ในการส่งข้อมูล
4. ทำ file .xsd เช็ก schema


5. เช็กว่า xml validate กับ schema หรือไม่
6. ส่ง xml ไปยัง client


Client side

user Python and Node JS

Python

result

Node JS


result


________________________________________________________________________________

ข้อที่ 2
Service ที่ 1


1. สร้าง table เก็บการส่งข้อมูล database

2. รับค่าจาก client
3. เขียน function insert ข้อมูล

Service ที่ 2


1. update ข้อมูลใน table ให้หมดจาก (sended = no) => (sended = yes)

Service ที่ 3


1. เรียกข้อมูลทั้งหมดออกมาดูจาก table
2. ทำ file .xsd เช็ก schema

3. เช็กว่า xml validate กับ schema หรือไม่
4. ส่ง xml ไปยัง client


Client side

user Python and Node JS

Python

service 1

service 2

service 3

result

Node JS

service 1

service 2

service 3

result

_________________________________________________________________________________

GitHub and Heroku
Server Github : https://github.com/tapetop18135/selectMidtermTest
Client Github : https://github.com/tapetop18135/selectMidtermClient

Server Heroku: https://minitestsoap.herokuapp.com/soapAPI1/?wsdl



Web Service นาย พันธกานต์ ขัดผาบ

ข้อ 1 แสดงชื่อ และประวัตของ นักศึกษา

     Service ที่ 1
         -  ให้ client request ไปให้ server และให้ server ส่ง response ออกมาให้ client
                                Server

Code ส่วน Service จะมีการตรวจสอบ xmlschema ด้วย library XMLSchema 
เมื่อ valid จะสามารถส่งข้อมูลไปให้ client

                                Client
                                
                                Result
  


ข้อ 2 ทำ Web Service ส่งของคล้าย EMS
    -  มีการเก็บข้อมูลสินค้า(order ของลูกค้า)
    -  อัพเดท order เมื่อมีการส่งของ

   Service ที่ 1
         -  เมื่อลูกค้าต้องการจะส่งของ จะมีการ บันทึก order

    Server

                                Client (insert และ update status)

   Service ที่ 2
         - เมื่อของส่งแล้วมีการ อัพเดท สถานะของ order(ส่งแล้ว)

    Server


   Service ที่ 3
         -  แสดงข้อมูลต่างๆ และมีการใส่ parameter
             -  getDataStored()
             -  getlistname(name)
             -  getlistadd(address)
             -  getlistweight(start,end)

    Server

                                          Client

Table detail


ตัวอย่าง ข้อมูล


git log Client


git log Server


master : Local
origin/master : Git hub
heroku/master : Heroku

ref:
    heroku : https://gopapa.herokuapp.com/soapAPI1?wsdl
    git-hub : https://github.com/eunhye1999/gopapa

วันอังคารที่ 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