Skip to content

Object reference not set to an instance of an object #11

@moinessim

Description

@moinessim
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------



[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.2")]
[System.ServiceModel.ServiceContractAttribute(Namespace="http://ec.gob.sri.ws.recepcion", ConfigurationName="RecepcionComprobantesOffline")]
public interface RecepcionComprobantesOffline
{
    
    [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
    [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)]
    [System.ServiceModel.ServiceKnownTypeAttribute(typeof(mensaje[]))]
    [System.ServiceModel.ServiceKnownTypeAttribute(typeof(comprobante[]))]
    System.Threading.Tasks.Task<validarComprobanteResponse> validarComprobanteAsync(validarComprobante request);
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.2")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://ec.gob.sri.ws.recepcion")]
public partial class respuestaSolicitud
{
    
    private string estadoField;
    
    private comprobante[] comprobantesField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)]
    public string estado
    {
        get
        {
            return this.estadoField;
        }
        set
        {
            this.estadoField = value;
        }
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)]
    [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable=false)]
    public comprobante[] comprobantes
    {
        get
        {
            return this.comprobantesField;
        }
        set
        {
            this.comprobantesField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.2")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://ec.gob.sri.ws.recepcion")]
public partial class comprobante
{
    
    private string claveAccesoField;
    
    private mensaje[] mensajesField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)]
    public string claveAcceso
    {
        get
        {
            return this.claveAccesoField;
        }
        set
        {
            this.claveAccesoField = value;
        }
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)]
    [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable=false)]
    public mensaje[] mensajes
    {
        get
        {
            return this.mensajesField;
        }
        set
        {
            this.mensajesField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.2")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://ec.gob.sri.ws.recepcion")]
public partial class mensaje
{
    
    private string identificadorField;
    
    private string mensaje1Field;
    
    private string informacionAdicionalField;
    
    private string tipoField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)]
    public string identificador
    {
        get
        {
            return this.identificadorField;
        }
        set
        {
            this.identificadorField = value;
        }
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("mensaje", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)]
    public string mensaje1
    {
        get
        {
            return this.mensaje1Field;
        }
        set
        {
            this.mensaje1Field = value;
        }
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)]
    public string informacionAdicional
    {
        get
        {
            return this.informacionAdicionalField;
        }
        set
        {
            this.informacionAdicionalField = value;
        }
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)]
    public string tipo
    {
        get
        {
            return this.tipoField;
        }
        set
        {
            this.tipoField = value;
        }
    }
}

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.2")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(WrapperName="validarComprobante", WrapperNamespace="http://ec.gob.sri.ws.recepcion", IsWrapped=true)]
public partial class validarComprobante
{
    
    [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://ec.gob.sri.ws.recepcion", Order=0)]
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="base64Binary")]
    public byte[] xml;
    
    public validarComprobante()
    {
    }
    
    public validarComprobante(byte[] xml)
    {
        this.xml = xml;
    }
}

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.2")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(WrapperName="validarComprobanteResponse", WrapperNamespace="http://ec.gob.sri.ws.recepcion", IsWrapped=true)]
public partial class validarComprobanteResponse
{
    
    [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://ec.gob.sri.ws.recepcion", Order=0)]
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
    public respuestaSolicitud RespuestaRecepcionComprobante;
    
    public validarComprobanteResponse()
    {
    }
    
    public validarComprobanteResponse(respuestaSolicitud RespuestaRecepcionComprobante)
    {
        this.RespuestaRecepcionComprobante = RespuestaRecepcionComprobante;
    }
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.2")]
public interface RecepcionComprobantesOfflineChannel : RecepcionComprobantesOffline, System.ServiceModel.IClientChannel
{
}

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.2")]
public partial class RecepcionComprobantesOfflineClient : System.ServiceModel.ClientBase<RecepcionComprobantesOffline>, RecepcionComprobantesOffline
{
    
    /// <summary>
    /// Implement this partial method to configure the service endpoint.
    /// </summary>
    /// <param name="serviceEndpoint">The endpoint to configure</param>
    /// <param name="clientCredentials">The client credentials</param>
    static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials);
    
    public RecepcionComprobantesOfflineClient() : 
            base(RecepcionComprobantesOfflineClient.GetDefaultBinding(), RecepcionComprobantesOfflineClient.GetDefaultEndpointAddress())
    {
        this.Endpoint.Name = EndpointConfiguration.RecepcionComprobantesOfflinePort.ToString();
        ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
    }
    
    public RecepcionComprobantesOfflineClient(EndpointConfiguration endpointConfiguration) : 
            base(RecepcionComprobantesOfflineClient.GetBindingForEndpoint(endpointConfiguration), RecepcionComprobantesOfflineClient.GetEndpointAddress(endpointConfiguration))
    {
        this.Endpoint.Name = endpointConfiguration.ToString();
        ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
    }
    
    public RecepcionComprobantesOfflineClient(EndpointConfiguration endpointConfiguration, string remoteAddress) : 
            base(RecepcionComprobantesOfflineClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress))
    {
        this.Endpoint.Name = endpointConfiguration.ToString();
        ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
    }
    
    public RecepcionComprobantesOfflineClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : 
            base(RecepcionComprobantesOfflineClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress)
    {
        this.Endpoint.Name = endpointConfiguration.ToString();
        ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
    }
    
    public RecepcionComprobantesOfflineClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
            base(binding, remoteAddress)
    {
    }
    
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    System.Threading.Tasks.Task<validarComprobanteResponse> RecepcionComprobantesOffline.validarComprobanteAsync(validarComprobante request)
    {
        return base.Channel.validarComprobanteAsync(request);
    }
    
    public System.Threading.Tasks.Task<validarComprobanteResponse> validarComprobanteAsync(byte[] xml)
    {
        validarComprobante inValue = new validarComprobante();
        inValue.xml = xml;
        return ((RecepcionComprobantesOffline)(this)).validarComprobanteAsync(inValue);
    }
    
    public virtual System.Threading.Tasks.Task OpenAsync()
    {
        return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action<System.IAsyncResult>(((System.ServiceModel.ICommunicationObject)(this)).EndOpen));
    }
    
    public virtual System.Threading.Tasks.Task CloseAsync()
    {
        return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action<System.IAsyncResult>(((System.ServiceModel.ICommunicationObject)(this)).EndClose));
    }
    
    private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
    {
        if ((endpointConfiguration == EndpointConfiguration.RecepcionComprobantesOfflinePort))
        {
            System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
            result.MaxBufferSize = int.MaxValue;
            result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
            result.MaxReceivedMessageSize = int.MaxValue;
            result.AllowCookies = true;
            result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport;
            return result;
        }
        throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
    }
    
    private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration)
    {
        if ((endpointConfiguration == EndpointConfiguration.RecepcionComprobantesOfflinePort))
        {
            return new System.ServiceModel.EndpointAddress("https://celcer.sri.gob.ec/comprobantes-electronicos-ws/RecepcionComprobantesOffli" +
                    "ne");
        }
        throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
    }
    
    private static System.ServiceModel.Channels.Binding GetDefaultBinding()
    {
        return RecepcionComprobantesOfflineClient.GetBindingForEndpoint(EndpointConfiguration.RecepcionComprobantesOfflinePort);
    }
    
    private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress()
    {
        return RecepcionComprobantesOfflineClient.GetEndpointAddress(EndpointConfiguration.RecepcionComprobantesOfflinePort);
    }
    
    public enum EndpointConfiguration
    {
        
        RecepcionComprobantesOfflinePort,
    }
}

Returns this exception:

Exception: Object reference not set to an instance of an object. Stack Trace: at System.Object.GetType()
at cs2fs.Convert.convertText@658.Invoke(SyntaxNode node)
at cs2fs.FSharpOutput.getExpr@218[a](FSharpFunc2 errorPrinter, Expr1 e)
at cs2fs.FSharpOutput.getExprNP@319[a](FSharpFunc2 errorPrinter, Expr1 e)
at cs2fs.FSharpOutput.getExprNP@319-1.Invoke(Expr1 e) at Microsoft.FSharp.Collections.Internal.IEnumerator.map@74.DoMoveNext(b& curr) at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator1.System-Collections-IEnumerator-MoveNext()
at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable1 source) at cs2fs.FSharpOutput.delimLineText(String sep, IEnumerable1 xs)
at cs2fs.FSharpOutput.getExpr@218[a](FSharpFunc2 errorPrinter, Expr1 e)
at cs2fs.FSharpOutput.getMember@175[a](FSharpFunc2 errorPrinter, String className, Expr1 x)
at Microsoft.FSharp.Collections.Internal.IEnumerator.map@74.DoMoveNext(b& curr)
at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator1.System-Collections-IEnumerator-MoveNext() at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable1 source)
at cs2fs.FSharpOutput.lineblock(IEnumerable1 xs) at cs2fs.FSharpOutput.getExpr@218[a](FSharpFunc2 errorPrinter, Expr1 e) at cs2fs.FSharpOutput.getExpr@218[a](FSharpFunc2 errorPrinter, Expr1 e) at cs2fs.FSharpOutput.getExprNP@319[a](FSharpFunc2 errorPrinter, Expr1 e) at cs2fs.FSharpOutput.getExprNP@319-1.Invoke(Expr1 e)
at Microsoft.FSharp.Collections.Internal.IEnumerator.map@74.DoMoveNext(b& curr)
at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator1.System-Collections-IEnumerator-MoveNext() at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable1 source)
at cs2fs.FSharpOutput.delimLineText(String sep, IEnumerable1 xs) at cs2fs.FSharpOutput.getExpr@218[a](FSharpFunc2 errorPrinter, Expr1 e) at cs2fs.FSharpOutput.getExprNP@319[a](FSharpFunc2 errorPrinter, Expr1 e) at cs2fs.FSharpOutput.getExprNP@319-1.Invoke(Expr1 e)
at Microsoft.FSharp.Collections.Internal.IEnumerator.map@74.DoMoveNext(b& curr)
at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator1.System-Collections-IEnumerator-MoveNext() at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable1 source)
at cs2fs.FSharpOutput.delimLineText(String sep, IEnumerable1 xs) at cs2fs.FSharpOutput.getExpr@218[a](FSharpFunc2 errorPrinter, Expr1 e) at cs2fs.FSharpOutput.getExpr@218[a](FSharpFunc2 errorPrinter, Expr1 e) at cs2fs.Convert.convertText(String csharp) at Server.Result.attempt[a](FSharpFunc2 f) in /build/src/Server/Server.fs:line 24

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions