From: Etienne R. <gra...@ya...> - 2006-06-25 15:11:28
|
> Now: > I'm using ZSI 1.7.0, and in particular the wsdl2py > script that came > with it, to get commected to a SOAP server that > seems pretty > complicated. It *is* complicated. There's an expression for such things, its known as a 'obfuscating software' ;) > Anyhow, the WSDL is here: > http://gitapi.golf.se/Member/Member1.asmx?WSDL > > And here is (the relevant parts of) my script for > retrieving a > certain blob of data (after having apparently > successfully run > wsdl2py to build Member1_services and > Member1_services_types): > > ####### > locator = Member1Locator() > service = locator.getMember1Soap() > > params = GetMemberMatrikelDataSoapInWrapper() > params._organizationalUnitID = > ns2.guid_Def("045d699c-4713-49cc- > b36a-4a23418012de") > params._memberType = ns1.MemberTypes_Def("ALL") > > response = service.GetMemberMatrikelData(params) > ####### > > This produces the following error: > > ----------------- > > Exception: ('Serializing GetMemberMatrikelData > xmlns="http:// > gitapi.golf.se/Member/Member1"._organizationalUnitID, > AttributeError > guid_Def instance has no attribute \'replace\'',) > Traceback: > function module body > in golfsoap.py at line 22 > function GetMemberMatrikelData > in Member1_services.py at line 153 > function Send â > in client.py at line 186 > function serialize â > in writer.py at line 74 > function serialize â > in TCcompound.py at line 153 > function cb â > in TCcompound.py at line 189 > > ----------------- > > ...now, since it seems like the cb-function is > trying to run the > "replace" method on the guid_Def() instance, rather > than on a string, > I imagine this could be a bug somewhere. But also > very likely is that > I am not using the generated code correctly, as I > feel very > bewildered by it. > > Would anyone help me out please? (Prefferably sooner > rather than > later, of course :P) I'd be happy to provide more > information if > necessary. > > Thanks! > > /Zach > > PS.. I have a PHP-script that I'm trying to mimic > for this, and it > seems very straightforward, but doing it in python > seems a lot more > complicated. This turns my perceptions completely > upside-down, having > long despised PHP for it's complexity and bloat. > Since I don't really > know what I'm doing here, would anyone care to > elaborate on the > differences between working with SOAP in PHP versus > Python? I think you should at least consider trying SOAPpy. People on this would not recommend it, because its getting deprecated and etc. However, I'm starting to think that ZSI is really good for making SOAP-based development, testing SOAP apps, etc. For production environments, I would not use it, because its too easy to get lost with the extra-erroneous wsdl2py stub code stuff. Furthermore, code-reusability is a good thing! So, why reinventing the wheel, when SOAPpy has all the features you need? However, I acknowledges that wsdl2py is rather good at making a *relatively simple* abstraction layer between the wsdl instance(s) and the user-based app. Maybe a more subtle approach would be to write a wsdl2py (instance) yourself, so it would be easier to learn the WSDL/SOAP/ZSI guts from the inside-out. Hope this helps, Etienne -- Etienne Robillard <er...@cp...> JID: incidah AT njs.netlab.cz YMS/MSN: granted14 AT yahoo.com TEL: +1 514.962.7703 __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |