开发者

[python-suds]Bug? One additional element is created when using Factory

开发者 https://www.devze.com 2023-03-16 21:37 出处:网络
I am using suds to call web service, but the debug log shows that the xml elements are not correct. It added one additional parent element. Does anyone know this is a bug or not? How to fix it? Why is

I am using suds to call web service, but the debug log shows that the xml elements are not correct. It added one additional parent element. Does anyone know this is a bug or not? How to fix it? Why is everything encoded within the assignmentID element? Sorry, I don't know how to post xml content. I saw a same post here: Having problems with Python SOAP using Suds

--code snippet--

    cl = Client(url)
    submitRes = cl.factory.create('submitResult')
    submitRes.assignmentID = elem.assignmentID
    submitRes.actualTime = '30'
    submitRes.bugID = '';
    submitRes.note = 'submit result from python client webserice'
    submitRes开发者_运维问答.status = 'FAIL' 
    submitRes.build = 'build03'
    print cl.service.submitResult(submitRes)      


When you print your WSDL it should have the function submitResult(). This should have a parameter say called ns4:result. So if the method is like submitResult(ns4:result) use factory.create('ns4:result'). Don't use the function name. Then pass result into cl.service.submitResult(result). I cannot know for sure this will work without looking at the wsdl but it should work if the WSDL is in this format.

Thanks, Chris

0

精彩评论

暂无评论...
验证码 换一张
取 消