parameters:
    oro_soap.loader.class:                        Oro\Bundle\SoapBundle\ServiceDefinition\Loader\OroSoapLoader
    oro_soap.handler.delete.class:                Oro\Bundle\SoapBundle\Handler\DeleteHandler
    oro_soap.handler.include_delegate.class:      Oro\Bundle\SoapBundle\Handler\DelegateIncludeHandler
    oro_soap.handler.include_total_header.class:  Oro\Bundle\SoapBundle\Handler\TotalHeaderHandler

    oro_soap.provider.metadata.chain.class:       Oro\Bundle\SoapBundle\Provider\ChainMetadataProvider
    oro_soap.provider.metadata.entity.class:      Oro\Bundle\SoapBundle\Provider\EntityMetadataProvider

    oro_soap.entity_serializer.class:             Oro\Bundle\SoapBundle\Serializer\EntitySerializer
    oro_soap.entity_accessor.class:               Oro\Bundle\SoapBundle\Serializer\EntityDataAccessor
    oro_soap.entity_data_transformer.class:       Oro\Bundle\SoapBundle\Serializer\EntityDataTransformer

    oro_soap.locale_listener.class:               Oro\Bundle\SoapBundle\EventListener\LocaleListener

    # override BeSimple annotation complex type loader
    besimple.soap.definition.loader.annot_complextype.class: Oro\Bundle\SoapBundle\ServiceDefinition\Loader\AnnotationComplexTypeLoader

services:
    oro_soap.loader:
        class: %oro_soap.loader.class%
        public: false
        arguments:
            - '@file_locator'
            - '@besimple.soap.definition.loader.annot_class'
        tags:
            - { name: besimple.soap.definition.loader }

    oro_soap.handler.delete.abstract:
        abstract: true
        calls:
            - [setOwnerDeletionManager, ['@oro_organization.owner_deletion_manager']]

    oro_soap.handler.delete:
        class: %oro_soap.handler.delete.class%
        parent: oro_soap.handler.delete.abstract

    oro_soap.manager.entity_manager.abstract:
        abstract: true
        calls:
            - [setEventDispatcher, ['@event_dispatcher']]
            - [setDoctrineHelper, ['@oro_entity.doctrine_helper']]
            - [setEntityClassNameHelper, ['@oro_entity.entity_class_name_helper']]
            - [setEntitySerializer, ['@oro_soap.entity_serializer']]

    oro_soap.handler.include_delegate:
        class: %oro_soap.handler.include_delegate.class%
        arguments:
            - '@service_container'

    oro_soap.handler.include:
        alias: oro_soap.handler.include_delegate

    oro_soap.handler.include_total_header:
        class: %oro_soap.handler.include_total_header.class%
        arguments:
            - '@oro_batch.orm.query_builder.count_query_optimizer'
        tags:
            - { name: oro_soap.include_handler, alias: totalCount }

    oro_soap.provider.metadata.chain:
        class: %oro_soap.provider.metadata.chain.class%

    oro_soap.provider.metadata.entity:
        class: %oro_soap.provider.metadata.entity.class%
        arguments:
            - '@oro_entity_config.config_manager'
            - '@translator'
        tags:
            - { name: oro_soap.metadata_provider }

    oro_soap.provider.metadata:
        alias: oro_soap.provider.metadata.chain

    oro_soap.entity_serializer.acl_protected_query_factory:
        class: Oro\Bundle\SoapBundle\Serializer\AclProtectedQueryFactory
        public: false
        arguments:
            - '@oro_api.entity_serializer.doctrine_helper'
            - '@oro_entity.query_hint_resolver'
            - '@oro_security.acl_helper'

    oro_soap.entity_serializer:
        class: %oro_soap.entity_serializer.class%
        arguments:
            - '@doctrine'
            - '@oro_entity_config.config_manager'
            - '@oro_soap.entity_accessor'
            - '@oro_soap.entity_data_transformer'
            - '@oro_soap.entity_serializer.acl_protected_query_factory'
        calls:
            - ["setFieldsFilter", ['@oro_security.serializer.filter_chain']]

    oro_soap.entity_accessor:
        class: %oro_soap.entity_accessor.class%

    oro_soap.entity_data_transformer:
        class: %oro_soap.entity_data_transformer.class%
        arguments:
            - '@service_container'

    # event listeners
    oro_soap.locale_listener:
        class: %oro_soap.locale_listener.class%
        arguments:
            - '@service_container'
        tags:
            - { name: kernel.event_subscriber }

    oro_soap.routing.options_resolver.old_options:
        class: Oro\Bundle\SoapBundle\Routing\OldOptionsRouteOptionsResolver
        public: false
        tags:
            - { name: routing.options_resolver }

    oro_soap.api_doc_handler.old_options:
        class: Oro\Bundle\SoapBundle\Routing\OldOptionsApiDocHandler
        public: false
        tags:
            - { name: nelmio_api_doc.extractor.handler }

#    disable soap property filter until user-level wsdl cache implemented
#    oro_soap.definition.field_filter:
#        class: Oro\Bundle\SoapBundle\ServiceDefinition\Loader\SoapAclFieldFilter
#        public: false
#        arguments:
#            - @security.authorization_checker
#        tags:
#            - { name: oro_soap.definition.loader_filter }
