Soappy Simple Trial

Source: Internet
Author: User

Recently, a module of a PHP project needs to be implemented in Python and isolated.

In the PHP code, found that the use of the SOAP protocol, did not touch before, checked, is a relatively old protocol, to achieve data communication. (It's basically an API for the HTTP protocol)

Post a SOAP introduction: http://www.ibm.com/developerworks/cn/xml/x-sisoap/

Baidu Search, Python has a sapppy implementation of the SOAP protocol, you can implement the server and the client. (There may be other better, I have tried, feel enough to use this first)

1. Site

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

2. Download

Https://pypi.python.org/packages/source/S/SOAPpy/SOAPpy-0.12.22.zip

3. Installation

the environment I'm using is centos6.2.

installation is also very simple

Unzip Soappy-0.12.22.zippython setup.py buildpython setup.py Install installation Complete, you can enter the Python command line,>>> import Soappy If you do not call the police, the installation is complete

4. Simple Test

I refer to the example of the official website in the terminal environment ran a bit, very smooth, successful.

server-side:

Finished processing dependencies for Soappy==0.12.22[[email protected] soappy-0.12.22]# Pythonpython 2.6.6 (r266:84292, Jan, 09:42:36) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on Linux2type "help", "copyright", "credits" or "license" fo R more information.>>> import soappy>>> def hello (): ...     Return "Hello World." ... >>> server = Soappy.soapserver (("0.0.0.0", 9096)) >>> server.registerfunction (hello) >> > Server.serve_forever ()

Client:

[Email protected] ~]# Pythonpython 2.6.6 (r266:84292, Jan, 09:42:36) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on Li Nux2type "Help", "copyright", "credits" or "license" for more information.>>> import soappy>>> server = Soappy.soapproxy ("http://localhost:9096/") >>> print Server.hello () Hello world.


Soappy Simple Trial

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.