开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜