nfephp-org / sped-esocial

API para comunicação com a Receita Federal, para atender aos requisitos do e-Social
Other
159 stars 108 forks source link

Metadados não encontrado para a criação da instância do DataSource do SpedTabelas TABELA9. #546

Closed andre-matos-uex closed 7 months ago

andre-matos-uex commented 7 months ago

Prezados, bom dia, Estou tentando implementar o método de consultar eventos do empregador e estou recebendo um erro 500 com a seguinte exception Metadados não encontrado para a criação da instância do DataSource do SpedTabelas TABELA9., alguém consegue auxiliar?

Script de comunicação:

$config = [
        'tpAmb' => 2,
        //tipo de ambiente 1 - Produção; 2 - Produção restrita - dados reais;3 - Produção restrita - dados fictícios.
        'verProc' => 'S_1.2.0',
        //Versão do processo de emissão do evento. Informar a versão do aplicativo emissor do evento.
        'eventoVersion' => 'S.1.2.0',
        //versão do layout do evento
        'serviceVersion' => '1.5.0',
        //versão do webservice
        'empregador' => [
            'tpInsc' => 1, //1-CNPJ, 2-CPF
            'nrInsc' => '99999999999999', //numero do documento
            'nmRazao' => 'Razão social',
        ],
        'transmissor' => [
            'tpInsc' => 1, //1-CNPJ, 2-CPF
            'nrInsc' => '99999999999999' //numero do documento
        ],
    ];
    $configJson = json_encode($config, JSON_PRETTY_PRINT);

    try {
        $content = file_get_contents('/home/Downloads/cert.pfx');
        $password = 'password';

        $certificate = Certificate::readPfx($content, $password);
        $soap = new SoapCurl($certificate);

        $tools = new Tools($configJson, $certificate);
        $tools->loadSoapClass($soap);

        $tpEvt = 'S-1000';
        $perapur = '2023-12'; //ou apenas o ano
        $response = $tools->consultarEventosEmpregador($tpEvt, $perapur);

        print_r($response); die;
        echo FakePretty::prettyPrint($response, '');
    } catch (\Exception $e) {
        echo $e->getMessage();
    }

Response XML:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Body>
        <s:Fault>
            <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">
                a:InternalServiceFault</faultcode>
            <faultstring xml:lang="en-US">ComponentActivator: could not instantiate
                ESocial.Dwl.Cirurgico.Nucleo.Controle.ConsultaIdentificadorEventos.ControleConsultaIdentificadoresEventosEmpregador
            </faultstring>
            <detail>
                <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel"
                    xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                    <HelpLink>groups.google.com/group/castle-project-users</HelpLink>
                    <InnerException>
                        <HelpLink i:nil="true" />
                        <InnerException>
                            <HelpLink>groups.google.com/group/castle-project-users</HelpLink>
                            <InnerException>
                                <HelpLink i:nil="true" />
                                <InnerException>
                                    <HelpLink i:nil="true" />
                                    <InnerException i:nil="true" />
                                    <Message>Metadados não encontrado para a criação da instância do DataSource do
                                        SpedTabelas TABELA9.</Message>
                                    <StackTrace> at
                                        Serpro.ESocial.RecepcaoEvento.Vep.DataSource.SpedTabelas.DataSourceSpedTabelas.InicializaInstancia(String
                                        identificadorTabela) in
                                        E:\Jenkins2\Slaves\workspace\DEBHE\DE604\PROD_REST\ESocial.RecepcaoEvento\src\Serpro.ESocial.RecepcaoEvento\Vep\DataSource\SpedTabelas\DataSourceSpedTabelas.cs:line
                                        272&#xD;
                                        at
                                        Serpro.ESocial.RecepcaoEvento.Vep.DataSource.SpedTabelas.DataSourceSpedTabelas..ctor(List`1
                                        parametros, ConfiguracaoUtil cu, IntegradorConsultaService ics) in
                                        E:\Jenkins2\Slaves\workspace\DEBHE\DE604\PROD_REST\ESocial.RecepcaoEvento\src\Serpro.ESocial.RecepcaoEvento\Vep\DataSource\SpedTabelas\DataSourceSpedTabelas.cs:line
                                        141&#xD;
                                        at
                                        ESocial.Dwl.Cirurgico.Nucleo.Dominio.DataSourceSpedTabelas.DataSourceTipoEvento..ctor(ConfiguracaoUtil
                                        cu, IntegradorConsultaService ics) in
                                        E:\Jenkins2\Slaves\workspace\DEBHE\DE604\ESocial.Dwl.Cirurgico.Nucleo\src\ESocial.Dwl.Cirurgico.Nucleo\Dominio\DataSourceSpedTabelas\DataSourceTipoEvento.cs:line
                                        19</StackTrace>
                                    <Type>Serpro.ESocial.RecepcaoEvento.ExcecaoRecepcaoEvento</Type>
                                </InnerException>
                                <Message>Exception has been thrown by the target of an invocation.</Message>
                                <StackTrace> at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[]
                                    arguments, Signature sig, Boolean constructor)&#xD;
                                    at System.Reflection.RuntimeConstructorInfo.Invoke(Object obj, BindingFlags
                                    invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)&#xD;
                                    at
                                    Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.FastCreateInstance(Type
                                    implType, Object[] arguments, ConstructorCandidate constructor)&#xD;
                                    at
                                    Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstanceCore(ConstructorCandidate
                                    constructor, Object[] arguments, Type implType)</StackTrace>
                                <Type>System.Reflection.TargetInvocationException</Type>
                            </InnerException>
                            <Message>ComponentActivator: could not instantiate
                                ESocial.Dwl.Cirurgico.Nucleo.Dominio.DataSourceSpedTabelas.DataSourceTipoEvento
                            </Message>
                            <StackTrace> at
                                Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstanceCore(ConstructorCandidate
                                constructor, Object[] arguments, Type implType)&#xD;
                                at
                                Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstance(CreationContext
                                context, ConstructorCandidate constructor, Object[] arguments)&#xD;
                                at
                                Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext
                                context)&#xD;
                                at
                                Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext
                                context, Burden burden)&#xD;
                                at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext
                                context, Boolean trackedExternally)&#xD;
                                at Castle.MicroKernel.Lifestyle.SingletonLifestyleManager.Resolve(CreationContext
                                context, IReleasePolicy releasePolicy)&#xD;
                                at Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context,
                                Boolean requiresDecommission, Boolean instanceRequired, Burden&amp; burden)&#xD;
                                at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean
                                instanceRequired)&#xD;
                                at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.Resolve(CreationContext
                                context, ISubDependencyResolver contextHandlerResolver, ComponentModel model,
                                DependencyModel dependency)&#xD;
                                at
                                Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateConstructorArguments(ConstructorCandidate
                                constructor, CreationContext context)&#xD;
                                at
                                Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext
                                context)&#xD;
                                at
                                Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext
                                context)&#xD;
                                at
                                Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext
                                context, Burden burden)&#xD;
                                at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext
                                context, Boolean trackedExternally)&#xD;
                                at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext
                                context, IReleasePolicy releasePolicy)&#xD;
                                at Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context,
                                Boolean requiresDecommission, Boolean instanceRequired, Burden&amp; burden)&#xD;
                                at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean
                                instanceRequired)&#xD;
                                at Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type service,
                                IDictionary additionalArguments, IReleasePolicy policy)&#xD;
                                at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type
                                service, IDictionary arguments, IReleasePolicy policy)&#xD;
                                at Castle.Windsor.WindsorContainer.Resolve[T]()&#xD;
                                at
                                ESocial.Dwl.Cirurgico.Nucleo.Controle.ConsultaIdentificadorEventos.ControleConsultaIdentificadoresEventosEmpregador..ctor()
                                in
                                E:\Jenkins2\Slaves\workspace\DEBHE\DE604\ESocial.Dwl.Cirurgico.Nucleo\src\ESocial.Dwl.Cirurgico.Nucleo\Controle\ConsultaIdentificadorEventos\ControleConsultaIdentificadoresEventosEmpregador.cs:line
                                60</StackTrace>
                            <Type>Castle.MicroKernel.ComponentActivator.ComponentActivatorException</Type>
                        </InnerException>
                        <Message>Exception has been thrown by the target of an invocation.</Message>
                        <StackTrace> at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments,
                            Signature sig, Boolean constructor)&#xD;
                            at System.Reflection.RuntimeConstructorInfo.Invoke(Object obj, BindingFlags invokeAttr,
                            Binder binder, Object[] parameters, CultureInfo culture)&#xD;
                            at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.FastCreateInstance(Type
                            implType, Object[] arguments, ConstructorCandidate constructor)&#xD;
                            at
                            Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstanceCore(ConstructorCandidate
                            constructor, Object[] arguments, Type implType)</StackTrace>
                        <Type>System.Reflection.TargetInvocationException</Type>
                    </InnerException>
                    <Message>ComponentActivator: could not instantiate
                        ESocial.Dwl.Cirurgico.Nucleo.Controle.ConsultaIdentificadorEventos.ControleConsultaIdentificadoresEventosEmpregador
                    </Message>
                    <StackTrace> at
                        Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstanceCore(ConstructorCandidate
                        constructor, Object[] arguments, Type implType)&#xD;
                        at
                        Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstance(CreationContext
                        context, ConstructorCandidate constructor, Object[] arguments)&#xD;
                        at
                        Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext
                        context)&#xD;
                        at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext
                        context, Burden burden)&#xD;
                        at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext context,
                        Boolean trackedExternally)&#xD;
                        at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext context,
                        IReleasePolicy releasePolicy)&#xD;
                        at Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean
                        requiresDecommission, Boolean instanceRequired, Burden&amp; burden)&#xD;
                        at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean
                        instanceRequired)&#xD;
                        at Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type service, IDictionary
                        additionalArguments, IReleasePolicy policy)&#xD;
                        at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service,
                        IDictionary arguments, IReleasePolicy policy)&#xD;
                        at Castle.Windsor.WindsorContainer.Resolve[T]()&#xD;
                        at
                        ESocial.Dwl.Cirurgico.Wcf.WsConsultarIdentificadoresEventos.ConsultarIdentificadoresEventosEmpregador(XmlElement
                        consultaEventosEmpregador)&#xD;
                        at SyncInvokeConsultarIdentificadoresEventosEmpregador(Object , Object[] , Object[] )&#xD;
                        at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs,
                        Object[]&amp; outputs)&#xD;
                        at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)&#xD;
                        at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp;
                        rpc)&#xD;
                        at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&amp;
                        rpc)&#xD;
                        at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace>
                    <Type>Castle.MicroKernel.ComponentActivator.ComponentActivatorException</Type>
                </ExceptionDetail>
            </detail>
        </s:Fault>
    </s:Body>
</s:Envelope>
robmachado commented 7 months ago

Prezado colega !! sabe o que InternalServiceFault significa ?? Esse é um problema do sistema do esocial e não da sua consulta !! é um erro interno ! deles !!!