below method lstImprtlogisticare is the object having data above 100kb. If the object having below 100kb data it is working fine.If more than 100kb getting communication exception as

The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.

an the code is

public int ImportLogistiCareData(List<Importlogisticare> lstImportlogisticare, int VendorId, TransportationVendorTypes vendorType)
        {
            try
            {
                using (LINAServiceClient oLINAServiceClient = new LINAServiceClient())
                {
                    Mapper.CreateMap<Importlogisticare, IMPORTLOGISTICARE>()
                        .ForMember(dest => dest.ID, opts => opts.MapFrom(src => src.ID))
                        .ForMember(dest => dest.REGION, opts => opts.MapFrom(src => src.Region))
                        .ForMember(dest => dest.TRIPID, opts => opts.MapFrom(src => src.Trip_Id))
                        .ForMember(dest => dest.JOBNO, opts => opts.MapFrom(src => src.Job_No))
                        .ForMember(dest => dest.DATEOFSERVICE, opts => opts.MapFrom(src => src.Dateof_Service))                      
                        .ForMember(dest => dest.DATEOF_BIRTH, opts => opts.MapFrom(src => src.Dateof_Birth))
                        .ForMember(dest => dest.AGE, opts => opts.MapFrom(src => src.Age))
                        .ForMember(dest => dest.HOME_PHONE, opts => opts.MapFrom(src => src.Home_Phone));
                    IMPORTLOGISTICARE[] oIMPORTLOGISTICARE = Mapper.Map<IMPORTLOGISTICARE[]>(lstImportlogisticare);

                    return oLINAServiceClient.ImportFile(null, oIMPORTLOGISTICARE, VendorId, Convert.ToInt32(lstImportlogisticare[0].LASTUPDATEDBY), vendorType);

                }
            }           
            catch (System.ServiceModel.CommunicationException)
            {
                throw;
            }
            catch (Exception)
            {
                throw;
            }
        }

Related posts

Recent Viewed