Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No matching global declaration available for the validation root. #544

Open
kevin-olbrich opened this issue Sep 26, 2017 · 1 comment
Open

Comments

@kevin-olbrich
Copy link

kevin-olbrich commented Sep 26, 2017

Env: Django with spyne
Url must be "exampleapi/submit" while operation is named "submitXmlMessage".

How can I solve this?

soap11env:Client.SchemaValidationError:4:0:ERROR:SCHEMASV:SCHEMAV_CVC_ELT_1: Element '{https://partner.example.com/xmlgw/submit}submitXmlMessage': No matching global declaration available for the validation root.

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^exampleapi/submit', DjangoView.as_view(
        services=[SubmitService], tns='http://partner.example.com/xchange/example-3.0',
        in_protocol=Soap11(validator='lxml'), out_protocol=Soap11()
    )),
    #url(r'^', include('cms.urls')),
]
class SubmitService(ServiceBase):
    @rpc(Unicode, Unicode, Unicode, _returns=Iterable(Unicode), _operation_name="submitXmlMessage")
    def submit(ctx, partnerno, xml, signature):
        filedate = str(time.time())
        debugpath = 'data/debug/api-msg/in/'
        f = open(debugpath + 'api-' + filedate + '.txt', 'w')
        f.write('partnerno\n')  # python will convert \n to os.linesep
        f.write(str(partnerno))  # python will convert \n to os.linesep
        f.write('\n\n\nxml\n')  # python will convert \n to os.linesep
        f.write(str(xml))  # python will convert \n to os.linesep
        f.write('\n\n\nsignature\n')  # python will convert \n to os.linesep
        f.write(str(signature))  # python will convert \n to os.linesep
        f.close()  # you can omit in most cases as the destructor will call it
        exit(500)


app = Application([SubmitService],
                  'http://partner.example.com/xchange/example-3.0',
                  out_protocol=Soap11(),
                  in_protocol=Soap11(validator='lxml'),
                  )

hello_world_service = csrf_exempt(DjangoApplication(app))

WSDL:

	<wsdl:portType name="XmlSubmitWebService">
		<wsdl:operation name="submitXmlMessage"
			            parameterOrder="partnerno xml signature">
			<wsdl:input message="impl:submitXmlMessageRequest"
				        name="submitXmlMessageRequest" />
			<wsdl:output message="impl:submitXmlMessageResponse"
				         name="submitXmlMessageResponse" />
		</wsdl:operation>
	</wsdl:portType>
@andrelfran
Copy link

How did you solve this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants