Фрагмент программы для загрузки данных ЭЛН в ФСС



//-- Создать первичный файл для сервиса prParseReestrFile

string regnum = "11111";
string eln = "22222";
string snils = "33333";
string filename = "D:\\temp\\FSS\\files\\test.xml";
string INN_PERSON = "661511111111";
string EMPLOYER = "ООО 32323232";
string EMPL_FLAG = "1";
string EMPL_PARENT_NO = "66111";
string EMPL_REG_NO2 = "";
string APPROVE1 = "XXXXXXX";
string APPROVE2 = "XXXXXXX";
string BASE_AVG_SAL = "YYYYYYYY";
string BASE_AVG_DAILY_SAL = "YYYYYYY";
string INSUR_YY = "7";
string INSUR_MM = "10";
string NOT_INSUR_YY = "";
string NOT_INSUR_MM = "";
string CALC_CONDITION1 = "";
string CALC_CONDITION2 = "";
string CALC_CONDITION3 = "";
string CALC_CONDITION4 = "";
string FORM1_DT = "";
string RETURN_DATE_EMPL = "2019-03-02";
string DT1_LN = "2019-02-25";
string DT2_LN = "2019-03-01";
string EMPL_PAYMENT = "";
string FSS_PAYMENT = "YYYYY";
string PAYMENT = "YYYYY";
string CORRECTION_REASON = "06";
string CORRECTION_NOTE = "test";
string LN_HASH = "7AB4";
string rez = api-fss.prParseReestrFile.Createfile_Correct_Data(regnum, eln, snils, filename, INN_PERSON, EMPLOYER, EMPL_FLAG, EMPL_PARENT_NO, EMPL_REG_NO2, APPROVE1, APPROVE2, BASE_AVG_SAL, BASE_AVG_DAILY_SAL, INSUR_YY, INSUR_MM, NOT_INSUR_YY, NOT_INSUR_MM, CALC_CONDITION1, CALC_CONDITION2, CALC_CONDITION3, CALC_CONDITION4, FORM1_DT, RETURN_DATE_EMPL, DT1_LN, DT2_LN, EMPL_PAYMENT, FSS_PAYMENT, PAYMENT, CORRECTION_REASON, CORRECTION_NOTE, LN_HASH);

//-- Считать сертификат страхователя

SerialNumberCerClient = "01AB18273187CE28373423";
api-fss.Crypto_Certif cr1 = api-fss.Crypto_Certif.getCrypto_CertifClient(SerialNumberCerClient);
if (cr1.x509 == null) return;
X509Certificate2 x509client = cr1.x509;


//-- Подписать файл для сервиса prParseReestrFile

string filein = "D:\\temp\\FSS\\files\\test.xml";
string fileout = "D:\\temp\\FSS\\files\\test1.xml"
X509Certificate2 Certificate = x509client;
api-fss.FSSSignedXml.SignPRFXmlFile(filein, fileout, Certificate, eln, snils);

//-- Считать сертификат ФСС

SerialNumberCerFSS = "2398423HG87KQ1728";
api-fss.Crypto_Certif cr2 = api-fss.Crypto_Certif.getCrypto_CertifFSS(SerialNumberCerFSS);
if (cr2.x509 == null) return;
X509Certificate2 x509FSS = cr2.x509;


//-- Зашифровать файл для сервиса prParseReestrFile

string filein = "D:\\temp\\FSS\\files\\test1.xml";
string fileout = "D:\\temp\\FSS\\files\\test2.xml";
X509Certificate2 certificateToEncrypt = x509FSS;
X509Certificate2 certificateToDecrypt = x509client;
api-fss.FSSSignedXml.EncryptXmlElement( filein, fileout, certificateToEncrypt, certificateToDecrypt);


//-- Вызвать сервис prParseReestrFile

string filein = "D:\\temp\\FSS\\files\\test2.xml";
string fileout = "D:\\temp\\FSS\\files\\test3.xml";
api-fss.CallService.call_ServiceFSS_prParseReestrFile( filein, fileout, regNum);

//-- расшифровать файл

string filein = "D:\\temp\\FSS\\files\\test3.xml";
string fileout = "D:\\temp\\FSS\\files\\test4.xml";
X509Certificate2 certificate = x509client;
api-fss.FSSSignedXml.DecryptXml( filein, fileout, certificate);


Итоговый файл - test4.xml:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header /> <SOAP-ENV:Body> <S:Envelope xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header> <wsse:Security S:actor="http://eln.fss.ru/actor/fss/ca/10277"> <wsse:BinarySecurityToken wsu:Id="http://eln.fss.ru/actor/fss/ca/10277" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">MIIIJTCCB9KgAwIBAgIRAMR1DVsR5NuA6BH0yrdPoB4wCgYIKoUDBwEBAwIwggEfMRwwGgYJKoZI hvcNAQkBFg11Y0B2b3NraG9kLnJ1MRgwFgYFKoUDZAESDTExNjc3NDYyODkyNDgxGjAYBggqhQMD gQMBARIMMDA3NzI5NDk4ODEzMQswCQYDVQQGEwJSVTEYMBYGA1UECAwPNzcg0JzQvtGB0LrQstCw MRkwFwYDVQQHDBDQsy4g0JzQvtGB0LrQstCwMTEwLwYDVQQJDCjRg9C70LjRhtCwINCj0LTQsNC7 0YzRhtC+0LLQsCwg0LTQvtC8IDg1MSkwJwYDVQQKDCDQpNCT0JHQoyDQndCY0JggwqvQktC+0YHR hdC+0LTCuzEpMCcGA1UEAwwg0KTQk9CR0KMg0J3QmNCYIMKr0JLQvtGB0YXQvtC0wrswHhcNMTgx MDA4MTIwNzI4WhcNMTkxMDA4MTIxNzI4WjCCAZQxGDAWBgUqhQNkARINMTAyNzczOTQ0MzIzNjEa MBgGCCqFAwOBAwEBEgwwMDc3MzYwNTY2NDcxNDAyBgNVBAkMK9Ce0YDQu9C40LrQvtCyINC/0LXR gNC10YPQu9C+0LosINC00L7QvCAz0LAxHzAdBgkqhkiG9w0BCQEWEGcucHJ5YW1vdkBmc3MucnUx CzAJBgNVBAYTAlJVMQswCQYDVQQIDAI3NzEZMBcGA1UEBwwQ0LMuINCc0L7RgdC60LLQsDFnMGUG A1UECgxe0KTQvtC90LQg0YHQvtGG0LjQsNC70YzQvdC+0LPQviDRgdGC0YDQsNGF0L7QstCw0L3Q uNGPINCg0L7RgdGB0LjQudGB0LrQvtC5INCk0LXQtNC10YDQsNGG0LjQuDFnMGUGA1UEAwxe0KT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+ 0LwgNzEsMCoGA1UECgwj0JzQuNC90LrQvtC80YHQstGP0LfRjCDQoNC+0YHRgdC40LgxGDAWBgUq hQNkARINMTA0NzcwMjAyNjcwMTEaMBgGCCqFAwOBAwEBEgwwMDc3MTA0NzQzNzUxLDAqBgNVBAMM I9Cc0LjQvdC60L7QvNGB0LLRj9C30Ywg0KDQvtGB0YHQuNC4ggsA1FjD1QAAAAAADDAdBgNVHQ4E FgQUWTMGoxM6kdg1ja3WzVXZ7fmciAYwJwYJKwYBBAGCNxUKBBowGDAKBggrBgEFBQcDAjAKBggr BgEFBQcDBDBxBgNVHR8EajBoMDGgL6AthitodHRwOi8vdWMudm9za2hvZC5ydS9jZHAvdm9za2hv ZF9nb3N0MTIuY3JsMDOgMaAvhi1odHRwOi8vY2RwMS52b3NraG9kLnJ1L2NkcC92b3NraG9kX2dv c3QxMi5jcmwwgYIGCCsGAQUFBwEBBHYwdDA3BggrBgEFBQcwAoYraHR0cDovL3VjLnZvc2tob2Qu cnUvY2RwL3Zvc2tob2RfZ29zdDEyLmNydDA5BggrBgEFBQcwAoYtaHR0cDovL2NkcDEudm9za2hv ZC5ydS9jZHAvdm9za2hvZF9nb3N0MTIuY3J0MCsGA1UdEAQkMCKADzIwMTgxMDA4MTIwNzI4WoEP MjAxOTEwMDgxMjA3MjhaMAoGCCqFAwcBAQMCA0EARL3AJp9nyZrm65prJa5xlFsA4RzpPJ76IUIb Dd3kHx5dBDivxvpSVcLPvO6jCGcfmOfdodaRiq3xJwal9FManQ==</wsse:BinarySecurityToken> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> <SignedInfo> <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments" /> <SignatureMethod Algorithm="urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102012-gostr34112012-256" /> <Reference URI="#OGRN_10277"> <Transforms> <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments" /> </Transforms> <DigestMethod Algorithm="urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34112012-256" /> <DigestValue>imGYsdcR0quqx3F399rlLJcDlr4zgLI/nMFsWQrij/8=</DigestValue> </Reference> </SignedInfo> <SignatureValue>0NKtO30bOvTcyLnPbY1VCtNLWl92VCltgboKmGMRHZsw/3dJJrhQUZO7B7PiXNzCZ/luDvAOhO5M YbPO0TtrNQ==</SignatureValue> <KeyInfo> <wsse:SecurityTokenReference> <wsse:Reference ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" URI="#http://eln.fss.ru/actor/fss/ca/10277" /> </wsse:SecurityTokenReference> </KeyInfo> </Signature> </wsse:Security> </SOAP-ENV:Header> <S:Body wsu:Id="OGRN_10277"> <ns1:prParseReestrFileResponse xmlns:ns2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:ns1="http://ru/ibs/fss/ln/ws/FileOperationsLn.wsdl"> <ns1:WSResult> <ns1:REQUEST_ID>LNDATAINS_333333_2019_09_20_00001</ns1:REQUEST_ID> <ns1:STATUS>1</ns1:STATUS> <ns1:MESS>OK</ns1:MESS> <ns1:INFO> <ns1:ROWSET> <ns1:ROW> <ns1:ROW_NO>1</ns1:ROW_NO> <ns1:LN_CODE>22222</ns1:LN_CODE> <ns1:LN_HASH>A8E0FD</ns1:LN_HASH> <ns1:LN_STATE>060</ns1:LN_STATE> <ns1:STATUS>1</ns1:STATUS> </ns1:ROW> </ns1:ROWSET> </ns1:INFO> </ns1:WSResult> </ns1:prParseReestrFileResponse> </S:Body> </S:Envelope> </SOAP-ENV:Body> </SOAP-ENV:Envelope>



Вернуться на главную страницу