On 05/13/2010 01:31 PM, Joshua J. Kugler wrote:
On Thursday 13 May 2010, Jeff Ortel elucidated thus:
> All,
>
> Suds currently has (2) ways (hooks) for users to plug in
> functionality (not including Transports). First, is the schema
> Doctor used to repair broken XSDs at runtime. Second, is the
> Binding.replyfilter used to alter the raw reply text. In most cases,
> the replyfilter is used to strip out undesirable characters before
> sax parsing.
>
> Recently, I needed to add a third hook to provide users with a means
> to modify the outgoing soap envelope for certain edge cases. Rather
> then add yet another one-off hook, it seems better to add a more
> general "plugin" facility. Something more formal and extensible.
> And so I did in 0.4 (beta).
>
> Please see:
https://fedorahosted.org/suds/wiki/Documentation#PLUGINS
> and provide comments/suggestions including additional hooks.
Initial comments (just clarification, mostly).
Thanks for you comments Joshua.
- Clarify in the docs exactly when the hooks get called
Excellent question! I'll beef up the description for each hook on the wiki and
epydocs.
, and what they contain.
Please see:
http://jortel.fedorapeople.org/suds/doc/suds.plugin.Plugin-class.html
"After client is initialized."
OK, but what (loosely) has happend at that point?
Primarily, the WSDL object has been constructed and digested.
And before *what*?
Creation of:
- The client.service object.
- The client.factory object.
- The ServiceDefinition ( which is what you see when you __str__() the client ).
What is the WSDL object?
The WSDL object isa wsdl.Definitions instance.
Please see:
http://jortel.fedorapeople.org/suds/doc/suds.plugin.InitContext-class.html
The raw file (object)?
Nope.
The response from urllib2.urlopen()?
Nope.
- Same for "loaded." What does "loading" a
WSDL or XSD entail?
Opening? Parsing? It says "contains the document root." But:
loaded: "called before loading"..."contains document root" Sounds
like
it's called after something is loaded...the name is confusing.
Agreed.
The description needs to be reworded for clarity. The term "load" refers to XML
document
loading which is basically open/download & SAX parsed into a DOM tree. The
'context'
argument isa plugin.LoadContext (
http://jortel.fedorapeople.org/suds/doc/suds.plugin.LoadContext-class.html ) which
contains the loaded document root which is a sax.Element.
"Sending" and "received" seem clear enough.
Cool.
I'm sure I'll have more comments...those were the ones that struck me
first.
Great. Thanks again!
j