xsdata.codegen.mappers.definitions module

class xsdata.codegen.mappers.definitions.DefinitionsMapper[source]

Bases: object

Map a definitions instance to message and service classes.

Currently only SOAP 1.1 bindings with rpc/document style is supported.

classmethod map(definitions)[source]

Step 1: Main mapper entry point.

Parameters

definitions (Definitions) –

Return type

List[Class]

classmethod map_port(definitions, port)[source]

Step 2: Match a ServicePort to a Binding and PortType object and delegate the process to the next entry point.

Parameters
Return type

Iterator[Class]

classmethod map_binding(definitions, binding, port_type, config)[source]

Step 3: Match every BindingOperation to a PortTypeOperation and delegate the process for each operation to the next entry point.

Parameters
Return type

Iterator[Class]

classmethod map_binding_operation(definitions, binding_operation, port_type_operation, config, name)[source]

Step 4: Convert a BindingOperation to a service class and delegate the process of all the message classes to the next entry point.

Parameters
Return type

Iterator[Class]

classmethod map_binding_operation_messages(definitions, operation, port_type_operation, name, style, namespace)[source]

Step 5: Map the BindingOperation messages to classes.

Parameters
Return type

Iterator[Class]

classmethod build_envelope_fault(definitions, port_type_operation, target)[source]

Build inner fault class with default fields.

Parameters
classmethod build_envelope_class(definitions, binding_message, port_type_message, name, style, namespace)[source]

Step 6.1: Build Envelope class for the given binding message with attributes from the port type message.

Parameters
Return type

Class

classmethod build_message_class(definitions, port_type_message)[source]

Step 6.2: Build the input/output message class of an rpc style operation.

Parameters
Return type

Class

classmethod build_inner_class(target, name, namespace=None)[source]

Build or retrieve an inner class for the given target class by the given name.

This helper will also create a forward reference attribute for the parent class.

Parameters
Return type

Class

classmethod map_port_type_message(message, namespace)[source]

Build an attribute for the given port type message.

Parameters
Return type

Iterator[Attr]

classmethod map_binding_message_parts(definitions, message, extended, ns_map)[source]

Find a Message instance and map its parts to attributes according to the the extensible element..

Parameters
Return type

Iterator[Attr]

classmethod build_parts_attributes(parts, ns_map)[source]

Build attributes for the given list of parts.

Parameters
  • parts (List[Part]) – List of parts

  • ns_map (Dict) – A prefix-URI Namespace mapping

Return type

Iterator[Attr]

classmethod operation_namespace(config)[source]
Parameters

config (Dict) –

Return type

Optional[str]

classmethod attributes(elements)[source]

Return all attributes from all extended elements as a dictionary.

Parameters

elements (Iterator[AnyElement]) –

Return type

Dict

classmethod build_attr(name, qname, native=False, forward=False, namespace=None, default=None)[source]

Builder method for attributes.

Parameters
Return type

Attr