SoapDynamicRequestPcpl 1.0.0

Requires NuGet 1.0.0 or higher.

Install-Package SoapDynamicRequestPcpl -Version 1.0.0
dotnet add package SoapDynamicRequestPcpl --version 1.0.0
<PackageReference Include="SoapDynamicRequestPcpl" Version="1.0.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SoapDynamicRequestPcpl --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SoapDynamicRequestPcpl, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install SoapDynamicRequestPcpl as a Cake Addin
#addin nuget:?package=SoapDynamicRequestPcpl&version=1.0.0

// Install SoapDynamicRequestPcpl as a Cake Tool
#tool nuget:?package=SoapDynamicRequestPcpl&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

WebServices Dynamic

This package has no dependencies.

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 703 9/16/2017

Supported:
>= .NETFramework 4.0

EXAMPLE:

namespace SoapDynamicRequestPcpl.Example
{
   /// <summary>
   /// Consumir WebServices Correios
   /// Autor: Paulo Cesar P Luna
   /// Data: 16/09/2017
   /// </summary>
   class Program
   {
       /// <summary>
       /// Consultar o Prazo de Entrega de uma CEP Origem para Cep Destino
       /// </summary>
       /// <param name="args"></param>
       static void Main(string[] args)
       {
           var urlAsmx = "http://ws.correios.com.br/calculador/CalcPrecoPrazo.asmx";
           var actionSoap = "CalcPrazo";
           var tipoServico = "40010"; // 40010 SEDEX Varejo / 40045 SEDEX a Cobrar Varejo / 40290 SEDEX Hoje Varejo / 41106 PAC Varejo...
           var cepOrigem = "22793-903";
           var cepDestino = "25235-190";

           // Configurar request
           var soapRequest = new SoapDynamicRequest();
           soapRequest.AddSoapSchemaUrl(url: urlAsmx);
           soapRequest.AddSoapAction(soapAction: actionSoap);

           // Adiconar params de consulta
           //<nCdServico>Tipo de serviço PAC/SEDEX etc...</nCdServico>
           soapRequest.AddSoapParameter("nCdServico", tipoServico);

           //<sCepOrigem>Cep Origem</sCepOrigem>
           soapRequest.AddSoapParameter("sCepOrigem", cepOrigem);

           //<sCepDestino>Cep Destino</sCepDestino>
           soapRequest.AddSoapParameter("sCepDestino", cepDestino);

           // Request consulta
           var xml = soapRequest.InvokeSoapRequestXml();

           // Imprimir Consulta
           Console.WriteLine(xml.InnerXml);

           Console.ReadKey();
       }
   }
}