Re: [pyatl] zsi sope complextype question and wsdl2py

From: Jeff M.
Sent on: Monday, February 15, 2010 3:04 PM
I'd personally love to see that.?

I spend 4 hours a day writing Python and the other 4 hours a day running a web cluster with 80k sites on it, all of which go through a Big IP. ?I've been looking for ways to automate certain things (SSL deployments, certain types of server affinity, and so on). That would be tremendously helpful.

Thanks for the head's up on the emulator. That's getting downloaded this afternoon.
Jeff


On Mon, Feb 15, 2010 at 2:56 PM, Matt Cauthorn <[address removed]> wrote:
Jeff/PyATL gang: If anyone is interested, I'm happy to do a preso on this library and how it works with our stuff at one of the meetups.? It's very basic and wouldn't warrant much more than a 15 minute session. I bet you all would have some excellent feedback for me as well - I'm not a programmer; just someone who loves to get stuff done with Python.

Also, there is (as of the last two weeks) an emulator for BigIP available for free. It'll run in most any VMware setup. For anyone that is interested: https://www.f5.com/trial/secure/

Regarding the Cheeseshop, I'll have to ask my employer...it may not be a problem.

Regards,
Matt


On Mon, Feb 15, 2010 at 12:34 PM, Jeff McNeil <[address removed]> wrote:
Ha, small world!

I had asked my buddy to see if F5 could stick it up on the Cheeseshop. That would be nice and helpful. ?I just haven't had a chance to schedule time with our lab F5 machines. There needs to be a simulator or something.?

I had been planning to write up a blog entry on it. ?Those little machines can do some very, very cool stuff. That API is pretty all-inclusive, too.

Jeff

On Mon, Feb 15, 2010 at 12:26 PM, Matt Cauthorn <[address removed]> wrote:
That's my library! Happy to help whenever you get going with it.

-Matt


On Mon, Feb 15, 2010 at 11:16 AM, Jeff McNeil <[address removed]> wrote:
Hi Matt --?

This is slightly off topic, but a buddy of mine works at F5 and they've released their 'PyControl' API updates recently. ?From what I understand, it's built on top of Suds. ?I've been meaning to try it out but haven't yet had the chance. ?

Might take some maintenance burden off of your hands.

Jeff


On Mon, Feb 15, 2010 at 9:56 AM, Matt Cauthorn <[address removed]> wrote:
Hi list - been lurking for a while now :). Fwiw had to ditch ZSI completely, for a bunch of reasons. The class generation is really nice in ZSI but I really needed support for soap encoded arrays and ZSI wasn't able to do this in a way that made sense. Also, the ServicProxy module, which I eventually fell back to in lieu of generated classes, produced a bunch of stub code that's never referenced...

Anyhow, if you're using this for client side code, I'd strongly suggest you look at Suds as Doug mentions above. It's a really nice library and the author (Jeff Ortel of Redhat) is ultra-responsive and is keen on writing a great library. I've had enormous success with this library. Recently Jeff has added some better caching support so if a pure proxy implementation gives you pause this should help a bit.

I've written a python wrapper for a slew of WSDLs for f5's BigIP application delivery controllers and it works great thanks to Suds. My ZSI-based version was less than ideal.

Regards,
Matt


On Sun, Feb 14, 2010 at 8:05 PM, Corey Osman <[address removed]> wrote:
Hi,

So I used the wsdl2py converter to convert a wsdl xml file to python code and have a few questions with some of the code generated.

The getProfileSoap function requires that you pass in a request type def that includes user credentials. ?This is fine but I am a little lost on how to exactly create this request. ?I figured I have to instantiate a Credential_Def with username, password but I am unsure of how to pass these variables in in order to create this type.?

>>?def?__init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):

The line above doesn't mention anything about username,password. ?Do I pass a string, list, dict? ?Do I need to create a ZSI.TC.String?


Anybody have experience with ZSI web services that can help me out?

thanks,


Core Osman

def getProfileSoap(self, request):
? ? ? ? if isinstance(request, getProfileSoapRequest) is False:
? ? ? ? ? ? raise TypeError, "%s incorrect request type" % (request.__class__)
? ? ? ? kw = {}
? ? ? ? # no input wsaction
? ? ? ? self.binding.Send(None, None, request, soapaction="urn:getProfileSoap", encodingStyle="http://schemas.xmlsoap.org/soap/encoding/", **kw)
? ? ? ? # no output wsaction
? ? ? ? typecode = Struct(pname=None, ofwhat=getProfileSoapResponse.typecode.ofwhat, pyclass=getProfileSoapResponse.typecode.pyclass)
? ? ? ? response = self.binding.Receive(typecode)
? ? ? ? return response

class getProfileSoapRequest:
? ? def __init__(self):
? ? ? ? self._cred = None
? ? ? ? self._userid = None
? ? ? ? return

class Credential_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
? ? ? ? schema = "urn:WebdialerSoap"
? ? ? ? type = (schema, "Credential")
? ? ? ? def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
? ? ? ? ? ? ns = ns0.Credential_Def.schema
? ? ? ? ? ? TClist = [ZSI.TC.String(pname="userID", aname="_userID", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="password", aname="_password", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
? ? ? ? ? ? self.attribute_typecode_dict = attributes or {}
? ? ? ? ? ? if extend: TClist += ofwhat
? ? ? ? ? ? if restrict: TClist = ofwhat
? ? ? ? ? ? ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
? ? ? ? ? ? class Holder:
? ? ? ? ? ? ? ? typecode = self
? ? ? ? ? ? ? ? def __init__(self):
? ? ? ? ? ? ? ? ? ? # pyclass
? ? ? ? ? ? ? ? ? ? self._userID = None
? ? ? ? ? ? ? ? ? ? self._password = None
? ? ? ? ? ? ? ? ? ? return
? ? ? ? ? ? Holder.__name__ = "Credential_Holder"
? ? ? ? ? ? self.pyclass = Holder



On Feb 13, 2010, at 7:27 PM, Doug Hellmann wrote:


On Feb 13, 2010, at 5:37 PM, Corey Osman wrote:

Hi,

I am working on a click to dial project where I need some python code
to use the cisco call manager soap interface to dial a phone number.
I have seen some php code but wanted to know if there was a python
wrapper around the soap calls that would make the CCM API easier. ?Has
anybody run across something like this. ?Google isn't turning up any
good results.

suds (https://fedorahosted.org/suds/) is a generic Python soap library, is that the sort of thing you mean? ?Or are you looking for something specific to this Cisco interface?

Doug




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
http://www.meetup.com/python-atlanta/
This message was sent by Doug Hellmann ([address removed]) from PyAtl: Atlanta Python Programmers.
To learn more about Doug Hellmann, visit his/her member profile: http://www.meetup.com/python-atlanta/members/234167/
To unsubscribe or to update your mailing list settings, click here: http://www.meetup.com/account/comm/
Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]






--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Corey Osman ([address removed]) from PyAtl: Atlanta Python Programmers.
To learn more about Corey Osman, visit his/her member profile
To unsubscribe or to update your mailing list settings, click here

Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Matt Cauthorn ([address removed]) from PyAtl: Atlanta Python Programmers.
To learn more about Matt Cauthorn, visit his/her member profile

To unsubscribe or to update your mailing list settings, click here

Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Jeff McNeil ([address removed]) from PyAtl: Atlanta Python Programmers.
To learn more about Jeff McNeil, visit his/her member profile

To unsubscribe or to update your mailing list settings, click here

Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Matt Cauthorn ([address removed]) from PyAtl: Atlanta Python Programmers.
To learn more about Matt Cauthorn, visit his/her member profile
To unsubscribe or to update your mailing list settings, click here

Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Jeff McNeil ([address removed]) from PyAtl: Atlanta Python Programmers.
To learn more about Jeff McNeil, visit his/her member profile
To unsubscribe or to update your mailing list settings, click here

Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Matt Cauthorn ([address removed]) from PyAtl: Atlanta Python Programmers.
To learn more about Matt Cauthorn, visit his/her member profile
To unsubscribe or to update your mailing list settings, click here

Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy