国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
SOAP for Python [知識(shí)庫(kù)]

SOAP for Python

SOAP: 簡(jiǎn)單對(duì)象訪問協(xié)議(Simple Object Access Protocol), 是一種輕量的、簡(jiǎn)單的、基于 XML 的協(xié)議, 它被設(shè)計(jì)成在 Web 上交換結(jié)構(gòu)化的和固化的信息. SOAP 可以和現(xiàn)存的許多因特網(wǎng)協(xié)議和格式結(jié)合使用, 包括 HTTP, SMTP, MIME. 它還支持從消息系統(tǒng)到遠(yuǎn)程過程調(diào)用(RPC)等大量的應(yīng)用程序.

Python SOAP Client

SUDS

Suds is a lightweight SOAP python client for consuming Web Services.

Install

sudo easy_install suds

Links

Sample

示例調(diào)用短信發(fā)送接口,java, XFire, SOAP WSDL, webservice

soap.py
#!/usr/bin/python#import logginglogging.basicConfig(level=logging.INFO) from suds.client import Clientfrom suds.sax.element import Element url = 'http://localhost:8080/SendSmsService?wsdl'client = Client(url) # custum soap headers for authenticationauth = Element('AuthenticationToken') system = Element('system').setText('SMS')auth.append(system)username = Element('username').setText('sms')auth.append(username)password = Element('password').setText('sms')auth.append(password)client.set_options(soapheaders=auth) client.service.sendSms('13912345678', 'python soap client through java soap server')

Python SOAP Server

SOAPLIB

Soaplib is an easy to use python library for publishing soap web services using WSDL 1.1 standard, and answering SOAP 1.1 requests. With a very small amount of code, soaplib allows you to write a useful web service and deploy it as a WSGI application. WSGI is a python web standard for writing portable, extendable web applications in python.

Install

sudo easy_install soaplib

Links

Sample

PHP SOAP Client

PHP的soap擴(kuò)展不支持自定義頭的認(rèn)證方式,不過可以通過自定義請(qǐng)求XML文件的方式來實(shí)現(xiàn)。以下文件需要PHP的soap擴(kuò)展,請(qǐng)先安裝后再運(yùn)行。

soap.php
    $wsdl = 'http://localhost:8080/services/SendSmsService?wsdl';    $client = new SoapClient($wsdl);     $reqXml = <<<XML<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:ns0="http://sendSms.webservice.com" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">   <SOAP-ENV:Header>      <AuthenticationToken>         <system>SMS</system>         <username>sms</username>         <password>sms</password>      </AuthenticationToken>   </SOAP-ENV:Header>   <ns1:Body>      <ns0:sendSms>         <ns0:in0>%s</ns0:in0>         <ns0:in1>%s</ns0:in1>         <ns0:in2>1</ns0:in2>      </ns0:sendSms>   </ns1:Body></SOAP-ENV:Envelope>XML;     $req = sprintf($reqXml, '13912345678', 'php soap client through java soap server');    $location = 'http://localhost:8080/services/SendSmsService';    $action = 'sendSms';     $result = $client->__doRequest($req, $location, $action, SOAP_1_1);
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
Python編寫WebService SOAP之原型
PHP5 擴(kuò)展SOAP 調(diào)用 webservice
RobotFrameWork WebService Soap接口測(cè)試 (一)
[轉(zhuǎn)]php soap操作
gSOAP Calculator Service and Client
python接口自動(dòng)化41-suds測(cè)試webservice接口
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服