Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Soap 不能将强制uuid(或其他与模式相关的必须是类型)用作rpc参数_Soap_Python 2.7_Django 1.5_Spyne - Fatal编程技术网

Soap 不能将强制uuid(或其他与模式相关的必须是类型)用作rpc参数

Soap 不能将强制uuid(或其他与模式相关的必须是类型)用作rpc参数,soap,python-2.7,django-1.5,spyne,Soap,Python 2.7,Django 1.5,Spyne,我有这样的Web服务: class ExampleService(ServiceBase): __tns__ = 'http://xml.company.com/ns/example/' @rpc(Mandatory.Uuid, _returns=Unicode) def say_my_uuid(ctx, uuid): return 'Your UUID: %s' % uuid @classmethod def dispatch(cls

我有这样的Web服务:

class ExampleService(ServiceBase):
    __tns__ = 'http://xml.company.com/ns/example/'

    @rpc(Mandatory.Uuid, _returns=Unicode)
    def say_my_uuid(ctx, uuid):
        return 'Your UUID: %s' % uuid

    @classmethod
    def dispatch(cls):
        application = Application([cls],
            tns=cls.__tns__,
            interface=Wsdl11(),
            in_protocol=Soap11(validator='lxml'),
            out_protocol=Soap11(cleanup_namespaces=True)
        )
        return csrf_exempt(DjangoApplication(application))
我可以使用
Uuid
作为参数,但当我尝试其强制版本时,服务器响应出现错误:

XMLSchemaParseError at /
simple type 'MandatoryUuid', attribute 'base': The QName value '{http://www.w3.org/2001/XMLSchema}MandatoryString' does not resolve to a(n) simple type definition., line 12
Exception Location: D:\Program Files\Python27\lib\site-packages\spyne\interface\xml_schema\_base.py in build_validation_schema, line 183

为什么我不能自定义
Uuid
类型?若我从它的定义中删除模式,那个么一切都是好的,但无论如何,UUID必须有一个模式。有什么解决办法吗?也许是另一个soap框架?

我刚刚发布了Spyne-2.9.5,其中包含了此问题的修复程序

您好,创建了以下repo:让我看看为什么会发生这种情况。使用您的代码,我遇到了相同的错误。请尝试2.9.5候选版本:。如果这解决了你的问题,我会很快发布一个新版本。