BipbopNet 1.0.0
dotnet add package BipbopNet --version 1.0.0
NuGet\Install-Package BipbopNet -Version 1.0.0
<PackageReference Include="BipbopNet" Version="1.0.0" />
paket add BipbopNet --version 1.0.0
#r "nuget: BipbopNet, 1.0.0"
// Install BipbopNet as a Cake Addin #addin nuget:?package=BipbopNet&version=1.0.0 // Install BipbopNet as a Cake Tool #tool nuget:?package=BipbopNet&version=1.0.0
Implementação do cliente BIPBOP para plataforma visa tornar mais fácil a integração dos nossos serviços em clientes que utilizem a tecnologia .NET. O WebService da BIPBOP é customizado para suportar:
- Grandes arquivos de informação consumindo pequeno footprint de memória nos servidores.
- Consultas a informação de maneira síncrona e assíncrona.
- Captura dos retornos de dados via WebSocket e callback HTTP.
TL-DR
var description = await Client.Description;
var rfbDatabase = description.Databases.First(database =>
string.Compare(database.Name, "RFB", StringComparison.OrdinalIgnoreCase) == 0);
var rfbTable = rfbDatabase.Tables.First(table =>
string.Compare(table.Name, "CERTIDAO", StringComparison.OrdinalIgnoreCase) == 0);
Assert.IsNotNull(rfbTable);
Assert.IsNotNull(rfbDatabase);
var query = await Client.Request("SELECT FROM 'RFB'.'CERTIDAO'", new[]
{
new KeyValuePair<string, string>("DOCUMENTO", "375.543.118-16"),
new KeyValuePair<string, string>("NASCIMENTO", "08/06/1990"),
});
Console.WriteLine(query.Document.SelectSingleNode("/BPQL/body//nome").InnerText);
Consultas Juristek
Recomendamos a criação de PUSHs para ambientes de produção para consumo assíncrono.
Consulta Direta
var JuristekClient = new Juristek.Client(new Client()));
var tjspTable = (await JuristekClient.Description).findTable(database: "TJSP", table: "PrimeiraInstancia");
var bipbopDocument = await JuristekClient.Request(tjspQuery);
var processos = new Processos(bipbopDocument.Document);
Assert.IsNotEmpty(processos.Retrieve);
var tjspQuery = new Query(tjspTable, new[]
{
new KeyValuePair<string, string>("NUMERO_PROCESSO", "0016306-32.2019.8.26.0502")
});
var bipbopDocument = await JuristekClient.Request(tjspQuery); // Requisição BIPBOP
var processos = new Processos(bipbopDocument.Document); // Parser do XML
Assert.IsNotEmpty(processos.Retrieve); // Retorna múltiplos processos pela numeração
Consulta CNJ
É possível consultas através da numeração CNJ sem passar a fonte.
var cnjQuery = Query.Cnj("0016306-32.2019.8.26.0502");
Assert.AreEqual(cnjQuery.ToString(),
"SELECT FROM 'CNJ'.'PROCESSO' WHERE 'NUMERO_PROCESSO' = '0016306-32.2019.8.26.0502' AND 'UPLOAD' = 'FALSE'");
Consulta OAB e CALLBACK HTTP
Feita necessáriamente com um CALLBACK HTTP.
var uniq = Guid.NewGuid().ToString("N");
var oabParameters = new OABParameters("312375")
{
Estado = Juristek.Client.Estado.SP,
OrigemOab = Juristek.Client.Estado.SP,
TipoInscricao = TipoInscricao.Advogado,
WebSocket = true,
Marker = uniq,
Label = uniq,
Callback = await listener.ServerAddr,
};
var oab = await JuristekClient.OabProcesso(oabParameters);
await JuristekClient.WebSocket.Start();
listener.OnRequest += (sender, args) => {
if (args.Exception) {
Console.WriteLine(args.ParserException);
return;
}
Console.WriteLine(new Processos(args.Document));
};
Criação de Consultas Assíncronas
var JuristekClient = new Juristek.Client(new Client()));
var listener = new Listener();
await listener.Start();
var cnjQuery = Query.Cnj("0016306-32.2019.8.26.0502");
var pushConfiguration = await JuristekClient.Push.Create(Juristek.Client.CreatePushConfiguration(cnjQuery,
new PushConfiguration
{
MaxVersion = 1,
Expire = DateTime.Now.AddMinutes(30),
Callback = await listener.ServerAddr
}));
listener.OnRequest += (sender, args) =>
{
if (args.Push.Id != pushConfiguration.Id) return;
listener.Stop();
};
await listener.HandleConnectionsAsync();
listener.StopSync();
Variáveis de Ambiente
São opcionais os envios através das variáveis de ambiente, os argumentos podem ser enviados no tempo de execução de sua aplicação.
- BIPBOP_APIKEY - Chave de API fornecida ao cliente.
- BIPBOP_ENDPOINT - Endereço da API fornecida pela BIPBOP, opcional.
- BIPBOP_WEBSOCKET - Chave de API fornecida ao cliente, opcional, padrão wss://irql.bipbop.com.br/.
- BIPBOP_PROXY - Endereço PROXY HTTP por onde a API será consultada, opcional.
- BIPBOP_SERVER - URL para ser usada de CALLBACK, exemplo: http://meuservico.com/retorno.
- BIPBOP_SERVER_PORT - Porta onde a aplicação escutará por retornos da BIPBOP.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Newtonsoft.Json (>= 12.0.3)
- Websocket.Client (>= 4.1.76)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 558 | 1/13/2020 |