по http://api-docs.diadoc.ru/ru/latest/howto/example_send_invoice.html
пробую
public static GeneratedFile GenerateinvoiceXml(string authToken, string box, string tobox)
{
try
{
var content = new InvoiceInfo()
{
// заполняем согласно структуре InvoiceInfo
InvoiceDate = "31.01.2016", // дата СФ
InvoiceNumber = "11-012016-2410000000", // номер СФ
Seller = {
BoxId = box
},
Buyer = {
BoxId = tobox
},
Signer = {
SignerCertificate = ReadFileContent(FileWithCertName)
},
PaymentDocuments = {
new PaymentDocumentInfo
{
DocumentDate = "08.08.2016",
DocumentNumber = "№00243015140"
}
},
Items = {
new InvoiceItem
{
Product = "Горячая вода (компонент на тепловую энергию). Прочие",
CountriesOfOrigin = { "23", "3243" } ,
TaxRate = TaxRate.Fraction_10_110,
Subtotal = "321231"
}
},
AdditionalInfos = {
new AdditionalInfo
{
Id = "2312321",
Value = "32423423"
}
},
Total = "1000"
};
return Api.GenerateInvoiceXml(authToken, content);
}
catch (Exception e)
{
logger.Debug("Except{0}", e, null);
Console.Read();
return null;
}
}
получаю
diadoc_cnsl.Program.GenerateinvoiceXml Debug: ExceptSystem.NullReferenceException: В экземпляре объекта не задана ссылка на объект. в diadoc_cnsl.Program.GenerateinvoiceXml(String authToken, String box, String tobox)
каким образом правильно сформировать сообщение?
как понимаю используется https://developers.google.com/protocol-buffers/docs/proto