SOAP: The Power Of Simplicity |
O'Reilly P2P Conference 2001 |
||
Copyright (C) 2001 Paul Kulchenko, Tony Hong |
When incoming requests are received, the SOAP::Lite server must
determine which package and method is actually being invoked, and then
load and execute that code. This is method dispatching. Unless
explicitly specified otherwise it's based on namespace URI and the name
of method element. Call for <ns:method xmlns:ns="http://namespaces.soaplite.com/My/Class">
will be dispatched to My::Class::method.
-> dispatch_to('My::Module'); # to give access to all methods
-> dispatch_to('My::Module::method'); # to give access to one method
directory(ies) and then modules will be loaded on demand:
-> dispatch_to('/use/local/soaplite/modules/');
Caveat: access to @INC is disabled during require due to security reasons.
directory(ies) and your modules:
-> dispatch_to('/use/local/soaplite/modules/',
'My::Module', 'My::AnotherModule::method');