Add new Hcs.Broker to communicate with ГИС ЖКХ via CryptoPro LibCore
This commit is contained in:
@ -0,0 +1,32 @@
|
||||
using Hcs.Broker.Internal;
|
||||
using Hcs.Service.Async.OrgRegistryCommon;
|
||||
|
||||
namespace Hcs.Broker.Api.Request.OrgRegistryCommon
|
||||
{
|
||||
internal class ExportDataProviderRequest(Client client) : OrgRegistryCommonRequestBase(client)
|
||||
{
|
||||
internal async Task<IEnumerable<exportDataProviderResultType>> ExecuteAsync(bool isActual, CancellationToken token)
|
||||
{
|
||||
// http://open-gkh.ru/OrganizationsRegistryCommon/exportDataProviderRequest.html
|
||||
var request = new exportDataProviderRequest
|
||||
{
|
||||
Id = Constants.SIGNED_XML_ELEMENT_ID,
|
||||
version = "10.0.2.1"
|
||||
};
|
||||
|
||||
if (isActual)
|
||||
{
|
||||
request.IsActual = true;
|
||||
request.IsActualSpecified = true;
|
||||
}
|
||||
|
||||
var result = await SendAndWaitResultAsync(request, async asyncClient =>
|
||||
{
|
||||
var response = await asyncClient.exportDataProviderAsync(CreateRequestHeader(), request);
|
||||
return response.AckRequest.Ack;
|
||||
}, token);
|
||||
|
||||
return result.Items.OfType<exportDataProviderResultType>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user