soap client - How to create wsse header with python-suds and adding attributes to it -
i trying add wsse header xml envelope interact webservice.
the xml should below
<?xml version="1.0" encoding="utf-8"?> <soap-env:envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.testingsite.com/------something" xmlns:ns2="http://www.testingsite.com/-----something" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <soap-env:header> <wsse:security mustunderstand = "true"></wsse:security> </soap-env:header> <ns0:body> <mainrequest></mainrequest> xmlns="http://www.everythingisosm.com/something"> <block1> xmlns="http://www.everythingisosm.com"> </block1> <requestparameters/> </mainrequest> </ns0:body> </soap-env:envelope>
and trying below code....
from suds.client import client suds.wsse import security url = "https://stackoverflow.com?wsdl" client = client(url, nosend = true) wsse = security() security.mustunderstand = "true"
and when print client
print str(client)
i have few methods in body
suds ( https://fedorahosted.org/suds/ ) version: 0.6 service ( memoservice ) tns=" ns1:"www.// , few namespaces___ ports (1): (memoservice) methods (6): method1(ns1:block1 block1, ns2:requestparameters requestparameters) method2(ns1:block1 block1, ns4:requestparameters requestparameters) method3(ns1:block1 block1, ns3:requestparameters requestparameters) method4(ns1:block1 block1, ns5:requestparameters requestparameters) metho5(ns1:block1 block1, ns6:requestparameters requestparameters) mainrequest(ns1:block1 block1, ns7:requestparameters requestparameters) types (1): ns8:miscamttype
i trying access mainrequest method by
client.service.mainrequest(block1, requestparameters)
and getting output without wsse header included. trying find documentation, seems feedora has removed now.
any help?
Comments
Post a Comment