惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Vercel News
Vercel News
T
Threatpost
G
Google Developers Blog
T
Threat Research - Cisco Blogs
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
The Exploit Database - CXSecurity.com
H
Heimdal Security Blog
Google DeepMind News
Google DeepMind News
Cyberwarzone
Cyberwarzone
T
The Blog of Author Tim Ferriss
Know Your Adversary
Know Your Adversary
Hacker News: Ask HN
Hacker News: Ask HN
www.infosecurity-magazine.com
www.infosecurity-magazine.com
S
Schneier on Security
B
Blog
V2EX - 技术
V2EX - 技术
NISL@THU
NISL@THU
C
CERT Recently Published Vulnerability Notes
W
WeLiveSecurity
C
Cybersecurity and Infrastructure Security Agency CISA
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Y
Y Combinator Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Spread Privacy
Spread Privacy
The Last Watchdog
The Last Watchdog
V
Vulnerabilities – Threatpost
N
Netflix TechBlog - Medium
Schneier on Security
Schneier on Security
F
Fortinet All Blogs
N
News | PayPal Newsroom
Attack and Defense Labs
Attack and Defense Labs
Blog — PlanetScale
Blog — PlanetScale
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
S
Security @ Cisco Blogs
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
P
Privacy & Cybersecurity Law Blog
P
Proofpoint News Feed
Project Zero
Project Zero
I
Intezer
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
SecWiki News
SecWiki News
Martin Fowler
Martin Fowler

博客园 - thh

svm资料收集 向量空间及其他相关数学结构 难题--autoconf、automake、libtool Linq 中不爽之处 关于UI设计的文章汇总 Window Live Writer LR 剖析器 MVP模式中的P和V关系 Guid、Int、BigInt编号的速度和存储空间的比较 静态构造函数线程安全的几个版本[转载] 区域性 ID 2155 (0x086B)不是受支持的区域性 解决方法 windbg给clr设置断点 python ip和int 互转函数 interface与pojo类之间的关系 关于OpenId Python SOAPpy访问asp.net web service 代码 Type.GetType 获得本Assembly以外的类型 NHibernate 代码生成工具 NHibernate使用笔记
Python SOAPpy 和 .net WebService
thh · 2007-03-23 · via 博客园 - thh

   项目中使用Python 2.2.3,装好了fsconst + SOAPpy后,创建了测试代码

def OpenProxy(url):
    from SOAPpy import WSDL
    proxy 
= WSDL.Proxy(url)
    proxy.soapproxy.config.dumpHeadersIn 
= 1
    proxy.soapproxy.config.dumpHeadersOut 
= 1
    proxy.soapproxy.config.dumpSOAPIn 
= 1
    proxy.soapproxy.config.dumpSOAPOut 
= 1
    proxy.soapproxy.config.debug 
= 9
    
return proxy
    
proxy 
= OpenProxy("http://localhost:1137/Web/Test/Service.asmx?WSDL")
proxy.Test(
345)

    

    写ASP.net服务器,vs中创建一个简单的Test方法:

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo 
= WsiProfiles.BasicProfile1_1)]
[SoapDocumentService(Use
=System.Web.Services.Description.SoapBindingUse.Encoded)]
public class Service : System.Web.Services.WebService
{

    
public Service()
    
{
    }


    [WebMethod]
    
public string HelloWorld()
    
{
        
return "Hello World";
    }


    [WebMethod(CacheDuration
=0)]
    
public int Test(int a)
    
{
        
return a + 1;
    }


}


    

[SoapDocumentService(Use=System.Web.Services.Description.SoapBindingUse.Encoded)]是出现问题的地方:
   在未添加之前,Test 返回的结果总是 1 ,a 的值未设置。python 的传递的参数未正确解析。看了python调试信息,把 proxy.Test(123)改成了proxy.Test(a=123),重新调用,xml请求的字段对了,但是 .net服务返回还是0。
   在http://mail.python.org/pipermail/xml-sig/2004-November/010733.html看到一些信息,按照上面的说明,加了[SoapDocumentService(Use=System.Web.Services.Description.SoapBindingUse.Encoded)],结果正确了,却不懂为什么。
   第一天是用SOAP,问题还真多!