Table Of Contents

Previous topic

Service

Next topic

Multiple Services

This Page

Application

The Application object in is used to build and serve the soap service.

class soaplib.core._base.Application(services, tns, name=None, _with_partnerlink=False)
class IN_WRAPPER
class Application.NO_WRAPPER
class Application.OUT_WRAPPER
Application.build_schema(types=None)

Unify the <schema> nodes required for this app.

This is a protected method.

Application.decompose_incoming_envelope(ctx, envelope_xml, xmlids=None)
Application.deserialize_soap(ctx, wrapper, envelope_xml, xmlids=None)

Takes a MethodContext instance and a string containing ONE soap message. Returns the corresponding native python object

Not meant to be overridden.

Application.get_class(key)
Application.get_class_instance(key)
Application.get_name()

Returns service name that is seen in the name attribute of the definitions tag.

Not meant to be overridden.

Application.get_namespace_prefix(ns)

Returns the namespace prefix for the given namespace. Creates a new one automatically if it doesn’t exist.

Not meant to be overridden.

Application.get_schema()

Simple accessor method that caches application’s xml schema, once generated.

Not meant to be overridden.

Application.get_service(service, http_req_env=None)

The function that maps service classes to service instances. Overriding this function is useful in case e.g. you need to pass additional parameters to service constructors.

Application.get_service_class(method_name)

This call maps method names to the services that will handle them.

Override this function to alter the method mappings. Just try not to get too crazy with regular expressions :)

Application.get_tns()

Returns default namespace that is seen in the targetNamespace attribute of the definitions tag.

Not meant to be overridden.

Application.get_wsdl(url)

Simple accessor method that caches the wsdl of the application, once generated.

Not meant to be overridden.

Application.name

Returns service name that is seen in the name attribute of the definitions tag.

Not meant to be overridden.

Application.on_exception_object(exc)

Called when the app throws an exception. (might be inside or outside the service call.

@param the wsgi environment @param the fault object

Application.on_exception_xml(fault_xml)

Called when the app throws an exception. (might be inside or outside the service call.

@param the wsgi environment @param the xml element containing the xml serialization of the fault

Application.parse_xml_string(xml_string, charset=None)
Application.process_request(ctx, req_obj)

Takes a MethodContext instance and the native request object. Returns the response to the request as a native python object.

Not meant to be overridden.

Application.serialize_soap(ctx, wrapper, out_object)

Takes a MethodContext instance and the object to be serialied. Returns the corresponding xml structure as an lxml.etree._Element instance.

Not meant to be overridden.

Application.set_namespace_prefix(ns, pref)

Forces a namespace prefix on a namespace by either creating it or moving the existing namespace to a new prefix.

Not meant to be overridden.

Application.tns

Returns default namespace that is seen in the targetNamespace attribute of the definitions tag.

Not meant to be overridden.

Application.validate(payload)

Method to be overriden to perform any sort of custom input validation.

ValidatingApplication

The ValidatingApplication validates XML messages and types against an auto-generated schema.

class soaplib.core._base.ValidatingApplication(services, tns, name=None, _with_partnerlink=False)
class IN_WRAPPER
class ValidatingApplication.NO_WRAPPER
class ValidatingApplication.OUT_WRAPPER
ValidatingApplication.build_schema(types=None)

Build application schema specifically for xml validation purposes.

ValidatingApplication.decompose_incoming_envelope(ctx, envelope_xml, xmlids=None)
ValidatingApplication.deserialize_soap(ctx, wrapper, envelope_xml, xmlids=None)

Takes a MethodContext instance and a string containing ONE soap message. Returns the corresponding native python object

Not meant to be overridden.

ValidatingApplication.get_class(key)
ValidatingApplication.get_class_instance(key)
ValidatingApplication.get_name()

Returns service name that is seen in the name attribute of the definitions tag.

Not meant to be overridden.

ValidatingApplication.get_namespace_prefix(ns)

Returns the namespace prefix for the given namespace. Creates a new one automatically if it doesn’t exist.

Not meant to be overridden.

ValidatingApplication.get_schema()

Simple accessor method that caches application’s xml schema, once generated.

Not meant to be overridden.

ValidatingApplication.get_service(service, http_req_env=None)

The function that maps service classes to service instances. Overriding this function is useful in case e.g. you need to pass additional parameters to service constructors.

ValidatingApplication.get_service_class(method_name)

This call maps method names to the services that will handle them.

Override this function to alter the method mappings. Just try not to get too crazy with regular expressions :)

ValidatingApplication.get_tns()

Returns default namespace that is seen in the targetNamespace attribute of the definitions tag.

Not meant to be overridden.

ValidatingApplication.get_wsdl(url)

Simple accessor method that caches the wsdl of the application, once generated.

Not meant to be overridden.

ValidatingApplication.name

Returns service name that is seen in the name attribute of the definitions tag.

Not meant to be overridden.

ValidatingApplication.on_exception_object(exc)

Called when the app throws an exception. (might be inside or outside the service call.

@param the wsgi environment @param the fault object

ValidatingApplication.on_exception_xml(fault_xml)

Called when the app throws an exception. (might be inside or outside the service call.

@param the wsgi environment @param the xml element containing the xml serialization of the fault

ValidatingApplication.parse_xml_string(xml_string, charset=None)
ValidatingApplication.process_request(ctx, req_obj)

Takes a MethodContext instance and the native request object. Returns the response to the request as a native python object.

Not meant to be overridden.

ValidatingApplication.serialize_soap(ctx, wrapper, out_object)

Takes a MethodContext instance and the object to be serialied. Returns the corresponding xml structure as an lxml.etree._Element instance.

Not meant to be overridden.

ValidatingApplication.set_namespace_prefix(ns, pref)

Forces a namespace prefix on a namespace by either creating it or moving the existing namespace to a new prefix.

Not meant to be overridden.

ValidatingApplication.tns

Returns default namespace that is seen in the targetNamespace attribute of the definitions tag.

Not meant to be overridden.

ValidatingApplication.validate(payload)