0

メッセージと型に個別の名前空間を使用する既存の WSDL を実装しています。

<message name="searchDetailRequest">
    <part element="ixa:searchDetail" name="body" />
</message>
<message name="searchDetailResponse">
    <part element="ixa:searchDetailResponse" name="result" />
</message>

    <operation name="searchDetail">
        <input message="tns:searchDetailRequest" />
        <output message="tns:searchDetailResponse" />
    </operation>

さまざまな名前空間を表すために、次のようなことを試みました。

class RXIType(ComplexModel):
    __namespace__ = 'urn:badger/ixa'


class searchDetailRequest(RXIType):
    intput = Unicode()


class searchDetailResponse(RXIType):
    output = Unicode()


class TestService(ServiceBase):
    @rpc(searchDetailRequest, _returns=searchDetailResponse, _body_style='bare')
    def searchDetail(cls, body):
        pass

soap = Application((TestService,),
                   'urn:badger/definitions',
                   in_protocol=Soap11(),
                   out_protocol=Soap11()
                   )

実行しようとすると例外が生成されます。

Traceback (most recent call last):
  File "./manage.py", line 14, in <module>
    from soapbridge import app
  File "/home/danni/src/GIT/s2x-hsnet-soap-bridge/soapbridge/__init__.py", line 52, in <module>
    out_protocol=Soap11()
  File "/home/danni/src/GIT/s2x-hsnet-soap-bridge/python_env/src/spyne/spyne/application.py", line 111, in __init__
    self.in_protocol.set_app(self)
  File "/home/danni/src/GIT/s2x-hsnet-soap-bridge/python_env/src/spyne/spyne/protocol/xml.py", line 324, in set_app
    xml_schema.build_validation_schema()
  File "/home/danni/src/GIT/s2x-hsnet-soap-bridge/python_env/src/spyne/spyne/interface/xml_schema/_base.py", line 221, in build_validation_schema
    self.validation_schema = etree.XMLSchema(etree.parse(f))
  File "xmlschema.pxi", line 90, in lxml.etree.XMLSchema.__init__ (src/lxml/lxml.etree.c:174715)
lxml.etree.XMLSchemaParseError: Element '{http://www.w3.org/2001/XMLSchema}element', attribute 'type': References from this schema to components in the namespace 'urn:badger' are not allowed, since not indicated by an import statement., line 9

ログ出力は、これが Spyne のエラーであることを示しています...助けてください!

4

1 に答える 1

0

これは確かにバグであり、リリースを待っているマスターですでに修正されています。待ちきれない場合は、次のようにします。

pip install -e git://github.com/arskom/spyne.git@60ed622b088c13f4f84c81f1f43302edbc7f6027#egg=spyne

そして問題はなくなる

于 2014-12-24T20:07:07.193 に答える