SOAPpy、C# 和对象传递
我正在尝试为我的 C# WebService 编写 SOAPpy 客户端。它以 null 形式到达:(
我怎样才能从 WebService 使用的 C# SOAP 解析器获取任何调试信息?
这就是 Python 发送的内容:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
>
<SOAP-ENV:Body>
<ns1:UpdateSession xmlns:ns1="http://www.xlogic.pl/SENACA" SOAP-ENC:root="1">
<xsd:Session>
<ID xsi:type="xsd:int">420</ID>
<RecordCreationTime SOAP-ENC:arrayType="xsd:ur-type[6]" xsi:type="SOAP-ENC:Array">
<item xsi:type="xsd:int">2010</item>
<item xsi:type="xsd:int">8</item>
<item xsi:type="xsd:int">17</item>
<item xsi:type="xsd:int">11</item>
<item xsi:type="xsd:int">13</item>
<item xsi:type="xsd:double">21.0</item>
</RecordCreationTime>
<ASP_SessionID xsi:type="xsd:string">92072674A04CB88D62776EA7</ASP_SessionID>
<LangID xsi:type="xsd:string">fr-FR</LangID>
<OneTimeKey xsi:type="xsd:string">a334cea18e014f4d8d04</OneTimeKey>
</xsd:Session>
</ns1:UpdateSession>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
这就是 C# 所期望的
<?xml version="1.0" encoding="utf-16"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://www.xlogic.pl/SENACA"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<tns:UpdateSession>
<s href="#id1"/>
</tns:UpdateSession>
<tns:Session id="id1" xsi:type="tns:Session">
<ID xsi:type="xsd:int">int</ID>
<RecordCreationTime
xsi:type="xsd:dateTime">dateTime</RecordCreationTime>
<ASP_SessionID xsi:type="xsd:string">string</ASP_SessionID>
<LangID xsi:type="xsd:string">string</LangID>
<OneTimeKey xsi:type="xsd:string">string</OneTimeKey>
</tns:Session>
</soap:Body>
</soap:Envelope>
I'm trying to write a SOAPpy client to my C# WebService. It is arriving as null :(
How can I get any debug from the C# SOAP parser that WebService uses?
This is what Python sends:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
>
<SOAP-ENV:Body>
<ns1:UpdateSession xmlns:ns1="http://www.xlogic.pl/SENACA" SOAP-ENC:root="1">
<xsd:Session>
<ID xsi:type="xsd:int">420</ID>
<RecordCreationTime SOAP-ENC:arrayType="xsd:ur-type[6]" xsi:type="SOAP-ENC:Array">
<item xsi:type="xsd:int">2010</item>
<item xsi:type="xsd:int">8</item>
<item xsi:type="xsd:int">17</item>
<item xsi:type="xsd:int">11</item>
<item xsi:type="xsd:int">13</item>
<item xsi:type="xsd:double">21.0</item>
</RecordCreationTime>
<ASP_SessionID xsi:type="xsd:string">92072674A04CB88D62776EA7</ASP_SessionID>
<LangID xsi:type="xsd:string">fr-FR</LangID>
<OneTimeKey xsi:type="xsd:string">a334cea18e014f4d8d04</OneTimeKey>
</xsd:Session>
</ns1:UpdateSession>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
This is what C# expects
<?xml version="1.0" encoding="utf-16"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://www.xlogic.pl/SENACA"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<tns:UpdateSession>
<s href="#id1"/>
</tns:UpdateSession>
<tns:Session id="id1" xsi:type="tns:Session">
<ID xsi:type="xsd:int">int</ID>
<RecordCreationTime
xsi:type="xsd:dateTime">dateTime</RecordCreationTime>
<ASP_SessionID xsi:type="xsd:string">string</ASP_SessionID>
<LangID xsi:type="xsd:string">string</LangID>
<OneTimeKey xsi:type="xsd:string">string</OneTimeKey>
</tns:Session>
</soap:Body>
</soap:Envelope>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不是 Python 答案,但 soapUI 是一个非常有用的 Web 服务调试和自动化测试工具。我在一个 C# WCF 项目中大量使用了它,该项目有多种客户端,包括 Python、Boo、Java 和 C#。
Not a Python answer, but soapUI is a very useful facility for debugging and automated testing of web services. I used it heavily on a C# WCF project, with a variety of clients, including Python, Boo, Java, and C#.