SOAP Web Service Server php Client Python part 1

Опубликовано: 27 Август 2016
на канале: jemix
8,218
211

Create WebService with php And Consuming With Python

Link WAMP
http://wampserver.com/

Link Python
https://www.python.org/

Link SOAPpy
https://pypi.python.org/pypi/SOAPpy


-First Step make sure SOAP enable on Wamp Server check php.ini and replaced (;extension=php_soap.dll ) with (extension=php_soap.dll) delete the ';' Semicolon

-Next Install SOAPpy with pip or easy_install
pip : pip install soappy
easy_install : easy_install soappy
check Module SOAPpy with cli python Command


help('SOAPpy')

you must get this output :
------------------------------------------------------------------------------------
NAME
SOAPpy

FILE
c:\python27\lib\site-packages\soappy\__init__.py

PACKAGE CONTENTS ...
------------------------------------------------------------------------------------
Finally Try My Codes
------------------------------------------------------------------------------------
Server SOAP
soap.php
------------------------------------------------------------------------------------
function add($a,$b){
return $a + $b;
}

$arg = array('uri' = 'http://jemiaymen.com');
$server = new SoapServer(null,$arg);
$server::addFunction('add');
$server::handle();
------------------------------------------------------------------------------------

Client SOAP
client-php.php
------------------------------------------------------------------------------------
$arg = array('uri' = 'http://jemiaymen.com' , 'location' = 'http://localhost/soap/soap.php');
$client = new SoapClient(null,$arg);
var_dump($client::add(88,885));
------------------------------------------------------------------------------------


Client Python
client-python.py
------------------------------------------------------------------------------------
from SOAPpy import SOAPProxy
client = SOAPProxy('http://localhost/soap/soap.php' , 'http://jemiaymen.com')
print client.add(78,88)
------------------------------------------------------------------------------------


На этой странице сайта вы можете посмотреть видео онлайн SOAP Web Service Server php Client Python part 1 длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь jemix 27 Август 2016, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 8,218 раз и оно понравилось 211 зрителям. Приятного просмотра!