当前位置: 首页 > 面试题库 >

SOAP肥皂水和可怕的架构类型未找到错误

郑正文
2023-03-14
问题内容

我第一次使用最新版本的suds(https://fedorahosted.org/suds/),而我却步入了第一步。

suds.TypeNotFound: Type not found: '(schema, http://www.w3.org/2001/XMLSchema, )'

现在,我知道这在suds世界中已广为报道(https://fedorahosted.org/suds/wiki/TipsAndTricks#Schema-
TypeNotFound
和Python /Suds:未找到类型:’xs:complexType’],但这似乎略有不同,因为(a)模式应该在版本0.3.4之后自动绑定,并且(b)甚至显式使用解决方法进行绑定,但它仍然无法正常工作。

from suds.client import Client
from suds.xsd.sxbasic import Import

url = 'file:wsdl.wsdl'
Import.bind('http://schemas.xmlsoap.org/soap/encoding/')
client = Client(url, cache = None)

与wsdl:

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://ws.client.com/Members.asmx"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
targetNamespace="http://ws.client.com/Members.asmx"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://ws.client.com/Members.asmx">

      <s:element name="GetCategoriesResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="GetCategoriesResult">
              <s:complexType>
                <s:sequence>
                  <s:element ref="s:schema" />
                  <s:any />
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>

    </s:schema>
  </wsdl:types>
</wsdl:definitions>

产生上面的异常。


问题答案:

即使它有点古怪,我们也能正常运行,我希望您也能做到。明确的位置或过滤器可能会有所帮助。例如:

imp = Import(
    'http://schemas.xmlsoap.org/soap/encoding/',
    location='http://schemas.xmlsoap.org/soap/encoding/'
)
imp.filter.add('http://ws.client.com/Members.asmx')
client = Client(url, plugins=[ImportDoctor(imp)])


 类似资料:
  • 我在CentOS机器上启用标题中提到的模块时遇到了一些问题。 百胜安装php-mCrypt/php-soc/php-mysql工作正常,并提到它们已经安装,重新启动Apache后,似乎它们没有启用。 例如,我无法定位mcrypt.so,运行php--ini会给出: 这是在我放置extension=mcrypt之后。所以在php中。伊尼。

  • 问题内容: 尝试指定自定义的肥皂标题。不知道如何填充SoapEnvelope.headerOut属性。 到目前为止我的代码? 这是标题WSDL提取… 问题答案: headerOut是您需要构建的Element []。 像这样 然后将其添加到数组中。

  • 从MSDN杂志https://MSDN.microsoft.com/en-us/magazine/dd315413.aspx和https://MSDN.microsoft.com/en-us/magazine/dd942839.aspx我了解到 当使用HTTP向RESTfulendpoint请求数据时,使用的HTTP谓词是GET。 但是使用HTTP POST从资源获取数据会违反REST体系结构吗?

  • 有什么想法吗?(角2)

  • 使用Web API和swashbuckle生成swagger文档,我在两个不同的名称空间中定义了两个同名的不同类。当我在浏览器中打开swagger页面时,它显示 冲突的schemaId:为类型A和B检测到重复的schemaID。请参阅配置设置-“UseFullTypeNameInSchemaIds”以了解潜在的解决方法 完整消息: 500:{“Message”:“发生错误。”,“Exception

  • 我创建了查询来根据日期间隔和房间类型搜索酒店的可用房间。当我运行此查询时,我得到以下错误: 组织。h2.jdbc。JdbcSQLException:未找到模式“R”;SQL语句: 有什么问题吗? 公共接口RoomRepository扩展JpaRepository{