From: <cm...@gm...> - 2009-08-26 21:21:32
|
Solved. 1) Changed the SignatureHandler to handel also digest passwords. 2) to get all working i using "binding" to add my header locator = PointTransferAndRedemptionLocator port = loc.getPointTransferAndRedemptionPortType(**kw) sigHandler = SignatureHandler("%USERNAME", "%PASSWORD", True) port.binding.sig_handler = sigHandler Thanx a lot icaro Am Wed, 26 Aug 2009 22:35:40 +0200 schrieb "cm...@gm..." <cm...@gm...>: > This should work, just one question. > How do you get the "sig_handler" working ? > > self.sC = > ContentServiceLocator().getContentService( url=self.Contenturl, > sig_handler = SignatureHandler(self.username,self.ticket)) > > 1) I wrote my own SignatureHandler class with all the params i need. > 2) i changed in PointTransferAndRedemption_services the service i need > to have the incoming parameter "soapheader=()" > > last: now i need to pass the signature to this function but i can not > get i to work. > > response = portType.addPrizeBookings(request,\ > sig_handler=SignatureHandler('sss','aaa')) > > Thanks a lot Mike > > Am Wed, 26 Aug 2009 20:35:30 +0200 > schrieb icaro icaro <ic...@gm...>: > > > I use a custom soap header in my little project > > > > http://bazaar.launchpad.net/~icaro0/pyalfresco/trunk/annotate/head%3A/src/pyAlfresco/pyAlfresco.py > > > > SignatureHandler class build the header and pass it to zsi call with > > sig_handler param. > > Hope it helps you > > > > On Wed, Aug 26, 2009 at 7:41 PM, cm...@gm... > > <cm...@gm...>wrote: > > > > > Hi all, > > > i have search in the archive but still found nothing that can help > > > me out. > > > > > > I'm writing a python client wich contacts a axis soap/xml server. > > > I'm ok whit the wsdl conversion and whit the primary request but > > > now i need to set the wsse:security header. > > > I have seen that using zsi.twisted i shuld be able to add this > > > header but found no way to do so. > > > > > > I added a part of my python code.¹ > > > > > > The actual result for the header is: > > > <soapenv:Header> > > > </soapenv:Header> > > > > > > but i need to convert this header to: > > > > > > <soapenv:Header> > > > <wsse:Security soapenv:mustUnderstand="1" > > > xmlns:wsse=" > > > http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd > > > "> > > > <wsu:Timestamp wsu:Id="Timestamp-10174046" > > > xmlns:wsu=" > > > http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd > > > "> > > > <wsu:Created>myCreated</wsu:Created> > > > <wsu:Expires>myExpires</wsu:Expires> > > > </wsu:Timestamp> > > > <wsse:UsernameToken wsu:Id="UsernameToken-11373030" > > > xmlns:wsu=" > > > http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd > > > "> > > > <wsse:Username>myUsername</wsse:Username> > > > <wsse:Password > > > Type=" > > > http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest > > > ">myPasswordElement</wsse:Password> > > > <wsse:Nonce>MyNonceElement</wsse:Nonce> > > > <wsu:Created>myCreated</wsu:Created> > > > </wsse:UsernameToken> > > > </wsse:Security> > > > > > > Thanks for every help. > > > Mike > > > > > > > > > > > > ¹================================================== > > > #ZSI installed > > > #wsdl2py -b -u http://xxxxx/PointTransferAndRedemption?wsdl > > > > > > from PointTransferAndRedemption_services import * > > > > > > import sys > > > import datetime > > > from datetime import date > > > > > > def main(): > > > loc = PointTransferAndRedemptionLocator() > > > > > > # prints messages sent and received if tracefile is set > > > kw = { 'tracefile' : sys.stdout} > > > > > > request = addPrizeBookingsRequest() > > > request._partnerCode = 'XXX' > > > request._poolCode = 'XXX' > > > request._bookingCodes = [] > > > request._bookingCodes.append('xxxx') > > > request._bookingCodes.append('yyyy') > > > request._validityStartDate = date.today().timetuple() > > > request._validityEndDate = date.today().timetuple() > > > > > > portType = loc.getPointTransferAndRedemptionPortType(**kw) > > > response = portType.addPrizeBookings(request) > > > print > > > "............................................................" > > > print "response is : " print response > > > > > > if "__main__" == __name__: > > > main() > > > ================================================== > > > > > > > > > ------------------------------------------------------------------------------ > > > Let Crystal Reports handle the reporting - Free Crystal Reports > > > 2008 30-Day trial. Simplify your report design, integration and > > > deployment - and focus on > > > what you do best, core application coding. Discover what's new > > > with Crystal Reports now. http://p.sf.net/sfu/bobj-july > > > _______________________________________________ > > > Pywebsvcs-talk mailing list > > > Pyw...@li... > > > https://lists.sourceforge.net/lists/listinfo/pywebsvcs-talk > > > Also archived at http://groups.google.com/group/pywebsvcs > > > > > > > > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day trial. Simplify your report design, integration and deployment > - and focus on what you do best, core application coding. Discover > what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Pywebsvcs-talk mailing list > Pyw...@li... > https://lists.sourceforge.net/lists/listinfo/pywebsvcs-talk > Also archived at http://groups.google.com/group/pywebsvcs |