navigate to the root of project install all required packages
pip install -r requirements.txt
edit SoapAndRest/settings.py. change database setting
# Postgresql
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'ws', # database name
'USER': 'test', # username
'PASSWORD': 'test', # password
'HOST': 'localhost', # server
'PORT': '5432' # port
}
}
python manage.py makemigrations
python manage.py makemigrations rest
python manage.py migrate
python manage.py runserver 8000
this will run server at port 8000
http://127.0.0.1:8000/rest/mock
http://127.0.0.1:8000/rest/country/all
http://127.0.0.1:8000/soap/?wsdl
GET http://127.0.0.1:8000/rest/country/1 GET Country info By ID=1
PUT http://127.0.0.1:8000/rest/country/1 Update Country info By ID=1
DELETE http://127.0.0.1:8000/rest/country/1 delete Country By ID=1
POST http://127.0.0.1:8000/rest/country create new country
Make Post Request to get country info by id=1
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:coun="country.soap.ws.api">
<soapenv:Header/>
<soapenv:Body>
<coun:getCountryById>
<!--Optional:-->
<coun:country_id>1</coun:country_id>
</coun:getCountryById>
</soapenv:Body>
</soapenv:Envelope>
Response
<soap11env:Envelope xmlns:soap11env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="country.soap.ws.api" xmlns:s0="soap.views">
<soap11env:Body>
<tns:getCountryByIdResponse>
<tns:getCountryByIdResult>
<s0:country_id>1</s0:country_id>
<s0:name>Japon</s0:name>
<s0:capital>Tokyo</s0:capital>
<s0:currency>JPY</s0:currency>
</tns:getCountryByIdResult>
</tns:getCountryByIdResponse>
</soap11env:Body>
</soap11env:Envelope>
install soapUI on your local machine. import the two xml files
REST-Project-soapui-project.xml
Soap-Project-soapui-project.xml
you will see the results as below
click the run button, this will run a test case with 100 threads and last 60 seconds.

