首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WSDL、XSD和soappy

WSDL、XSD和soappy
EN

Stack Overflow用户
提问于 2010-12-01 01:30:37
回答 2查看 1.6K关注 0票数 0

我有以下WSDL和XSD

代码语言:javascript
复制
from SOAPpy import WSDL
import os

# you'll need to configure these two values;
# see http://www.google.com/apis/
WSDLFILE = os.path.join(os.path.dirname(__file__), "getiwsAesPayment.wsdl") 

_server = WSDL.Proxy(WSDLFILE)


print _server

这给了我一个错误:

代码语言:javascript
复制
   schema.load(reader)
  File "/home/gregory/.virtualenvs/casadeal/src/soappy/SOAPpy/wstools/XMLSchema.py", line 1205, in load
    tp.fromDom(childNode)
  File "/home/gregory/.virtualenvs/casadeal/src/soappy/SOAPpy/wstools/XMLSchema.py", line 1322, in fromDom
    raise SchemaError, 'namespace of schema and import match'
SOAPpy.wstools.XMLSchema.SchemaError: namespace of schema and import match

显然,这可能是因为wsdl和xsd的targetNamespace是相同的?

WSDL

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="getiwsAesPayment" targetNamespace="http://ws.AMANTY.m2t.biz/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://ws.AMANTY.m2t.biz/" xmlns="http://schemas.xmlsoap.org/wsdl/">
  <types>
    <xsd:schema>
      <xsd:import namespace="http://ws.AMANTY.m2t.biz/" schemaLocation="getiwsAesPayment.xsd"/>
    </xsd:schema>
  </types>
  <message name="getiwsaespayment">
    <part name="parameters" element="tns:getiwsaespayment">
    </part>
  </message>
  <message name="getiwsaespaymentResponse">
    <part name="parameters" element="tns:getiwsaespaymentResponse">
    </part>
  </message>
  <portType name="getiwsAesPayment">
    <operation name="getiwsaespayment">
      <input message="tns:getiwsaespayment">
    </input>
      <output message="tns:getiwsaespaymentResponse">
    </output>
    </operation>
  </portType>
  <binding name="getiwsAesPaymentPortBinding" type="tns:getiwsAesPayment">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="getiwsaespayment">
      <soap:operation soapAction=""/>
      <input>
        <soap:body use="literal"/>
      </input>
      <output>
        <soap:body use="literal"/>
      </output>
    </operation>
  </binding>
  <service name="getiwsAesPaymentService">
    <port name="getiwsAesPaymentPort" binding="tns:getiwsAesPaymentPortBinding">
      <soap:address location="http://partner.ma:8080/AMANTYWebServicesWAR/getiwsAesPayment"/>
    </port>
  </service>
</definitions>

XSD

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema version="1.0" targetNamespace="http://ws.AMANTY.m2t.biz/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://ws.AMANTY.m2t.biz/">

  <xs:element name="commandReg" type="tns:commandReg"/>

   .......
   </xs:schema>
EN

回答 2

Stack Overflow用户

发布于 2011-03-03 20:40:01

尝试在wsdl中包含(而不是导入)其他xsd

票数 0
EN

Stack Overflow用户

发布于 2011-03-04 19:38:54

或者简单地使用SUDS :)它可以与新的SOAP标准一起工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4316608

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档