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

推荐订阅源

Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
The Register - Security
The Register - Security
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
P
Proofpoint News Feed
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
The Last Watchdog
The Last Watchdog
F
Fortinet All Blogs
S
Schneier on Security
Help Net Security
Help Net Security
Security Archives - TechRepublic
Security Archives - TechRepublic
C
Check Point Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
I
InfoQ
T
The Blog of Author Tim Ferriss
Cisco Talos Blog
Cisco Talos Blog
Stack Overflow Blog
Stack Overflow Blog
T
Troy Hunt's Blog
人人都是产品经理
人人都是产品经理
T
Threatpost
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cyber Attacks, Cyber Crime and Cyber Security
雷峰网
雷峰网
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
Forbes - Security
Forbes - Security
Vercel News
Vercel News
S
Security Affairs
美团技术团队
P
Privacy & Cybersecurity Law Blog
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Jina AI
Jina AI
Spread Privacy
Spread Privacy
Attack and Defense Labs
Attack and Defense Labs
IT之家
IT之家
U
Unit 42
Recorded Future
Recorded Future
W
WeLiveSecurity
PCI Perspectives
PCI Perspectives
P
Palo Alto Networks Blog
H
Hacker News: Front Page
S
Security @ Cisco Blogs
博客园 - 【当耐特】

博客园 - 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,问题还真多!