I am performing a method using channelFactory for Invoice Shipping -E Dian Via Channel Factory
First question: have you done this?
If possible, do something similar to this:
void SendFacturaFactory()
{
BasicHttpBinding binding = new BasicHttpBinding();
EndpointAddress address = new
EndpointAddress("https://facturaelectronica.dian.gov.co");
ChannelFactory<IRequestChannel> factory = new
ChannelFactory<IRequestChannel>(binding, address);
IRequestChannel MychannelFactura = factory.CreateChannel();
MychannelFactura.Open();
Message request = Message.CreateMessage(MessageVersion.Soap11, "hello");
var request = new FacturaDianRequest()
{
NIT = "8333111111",
InvoiceNumber = "FACO2",
IssueDate = "2018-10-30 ",
Document = //ruta archivo encrip y en zip,
}
Message reply = MychannelFactura.Request(request);
Console.Out.WriteLine(reply.Headers.Action);
reply.Close();
MychannelFactura.Close();
factory.Close();
}
2nd. I have previously worked on a single project with ChannelFactory, I do not know if I have built the message request well to track the successful and unsuccessful sending of invoices.