Previous topic

Server

Next topic

Application

This Page

Service

The service module provides the methods and classes for producing the soap service

class soaplib.core.service.Alias(**kwargs)

New type_name, same type_info.

class Annotations
class Alias.Attributes
class Alias.Empty
classmethod Alias.add_to_schema(schema_dict)
classmethod Alias.customize(**kwargs)

This function duplicates and customizes the class it belongs to. The original class remains unchanged. This is an ugly hack. If you know better, let us know.

classmethod Alias.from_string(xml_string)
classmethod Alias.from_xml(element)
classmethod Alias.get_deserialization_instance()
classmethod Alias.get_members(inst, parent)
classmethod Alias.get_namespace()
classmethod Alias.get_namespace_prefix(app)
classmethod Alias.get_serialization_instance(value)
classmethod Alias.get_type_name()
classmethod Alias.get_type_name_ns(app)
static Alias.is_default()
static Alias.produce(namespace, type_name, members)

Lets you create a class programmatically.

static Alias.resolve_namespace(default_ns)
classmethod Alias.to_parent_element(value, tns, parent_elt, *args, **kwargs)
class soaplib.core.service.DefinitionBase(environ=None)

This class serves as the base for all soap services. Subclasses of this class will use the rpc decorator to flag methods to be exposed via soap. This class is responsible for generating the wsdl for this service definition.

It is a natural abstract base class, because it’s of no use without any method definitions, hence the ‘Base’ suffix in the name.

add_bindings_for_methods(app, root, service_name, types, url, binding, transport, cb_binding=None)

A private method for adding bindings to the wsdl

@param the root element of the wsdl @param the name of this service

add_messages_for_methods(app, root, messages)

A private method for adding message elements to the wsdl @param the the root element of the wsdl

add_port_type(app, root, service_name, types, url, port_type)
add_schema(schema_entries)

A method for adding the appropriate entries to the schema for the types in the specified methods.

@param the schema node to add the schema elements to. if it is None,
the schema nodes are returned inside a dictionary
@param the schema node dictinary, where keys are prefixes of the schema
stored schema node
build_public_methods()

Returns a list of method descriptors for this object

call_wrapper(call, params)

Called in place of the original method call.

@param the original method call @param the arguments to the call

check_method_port(method)
get_method(name)

Returns the metod descriptor based on element name or soap action.

classmethod get_port_types()
classmethod get_service_class_name()
classmethod get_service_interface()
get_service_names()

Returns the service name(s) for this service. If this object has callbacks, then a second service is declared in the wsdl for those callbacks.

classmethod get_tns()
header_objects()
on_method_call(method_name, py_params, soap_params)

Called BEFORE the service implementing the functionality is called

@param the method name @param the tuple of python params being passed to the method @param the soap elements for each argument

on_method_exception_object(exc)

Called BEFORE the exception is serialized, when an error occurs during execution.

@param the exception object

on_method_exception_xml(fault_xml)

Called AFTER the exception is serialized, when an error occurs during execution.

@param the xml element containing the exception object serialized to a soap fault

on_method_return_object(py_results)

Called AFTER the service implementing the functionality is called, with native return object as argument

@param the python results from the method

on_method_return_xml(soap_results)

Called AFTER the service implementing the functionality is called, with native return object serialized to Element objects as argument.

@param the xml element containing the return value(s) from the method

soaplib.core.service.document(*params, **kparams)

Method decorator to flag a method as a document-style operation.

It will behave like a normal python method on a class, and will only behave differently when the keyword ‘_method_descriptor’ is passed in, returning a ‘MethodDescriptor’ object.

This decorator does none of the soap/xml serialization, only flags a method as a soap method. This decorator should only be used on member methods of an instance of a class derived from ‘ServiceBase’.

Moving forward, this method is being depricated in favor of @soap Presently it simply calls @soap after setting _style keyword argument to soaplib.core.DOC_STYLE

soaplib.core.service.rpc(*params, **kparams)

This is a method decorator to flag a method as a remote procedure call. It will behave like a normal python method on a class, and will only behave differently when the keyword ‘_method_descriptor’ is passed in, returning a ‘MethodDescriptor’ object. This decorator does none of the soap/xml serialization, only flags a method as a soap method. This decorator should only be used on member methods of an instance of ServiceBase.

Moving forward, this method is being depricated in favor of @soap Presently it simply calls @soap after checking for the _style keyword argument. If the _style argument is not supplied it defaults to soaplib.core.styles.RPC_STYLE

soaplib.core.service.soap(*params, **kparams)

This is a method decorator to flag a method as a remote procedure call. It will behave like a normal python method on a class, and will only behave differently when the keyword ‘_method_descriptor’ is passed in, returning a ‘MethodDescriptor’ object. This decorator does none of the soap/xml serialization, only flags a method as a soap method. This decorator should only be used on member methods of an instance of ServiceBase.