Jinget.Handlers.ExternalServiceHandlers 8.0.50

Prefix Reserved
dotnet add package Jinget.Handlers.ExternalServiceHandlers --version 8.0.50
                    
NuGet\Install-Package Jinget.Handlers.ExternalServiceHandlers -Version 8.0.50
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Jinget.Handlers.ExternalServiceHandlers" Version="8.0.50" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Jinget.Handlers.ExternalServiceHandlers" Version="8.0.50" />
                    
Directory.Packages.props
<PackageReference Include="Jinget.Handlers.ExternalServiceHandlers" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Jinget.Handlers.ExternalServiceHandlers --version 8.0.50
                    
#r "nuget: Jinget.Handlers.ExternalServiceHandlers, 8.0.50"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Jinget.Handlers.ExternalServiceHandlers@8.0.50
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Jinget.Handlers.ExternalServiceHandlers&version=8.0.50
                    
Install as a Cake Addin
#tool nuget:?package=Jinget.Handlers.ExternalServiceHandlers&version=8.0.50
                    
Install as a Cake Tool

Jinget

We are currently in the way to make Jinget an open source project, during this journey we will publish different parts of Jinget

Jinget.Handlers.ExternalServiceHandlers

The purpose of this package is to facilitate communication and use of various types of web services and Web APIs including Rest APIs and SOAP web services.

How to Use:

  1. Download the package from NuGet using Package Manager: Install-Package Jinget.Handlers.ExternalServiceHandlers You can also use other methods supported by NuGet. Check Here for more information. Then register th DI configuration like this:
builder.Services.AddJingetExternalServiceHandler("jinget-client", true);

You can replace jinget-client with your desired client name. if not specified then by default jinget-client will be used as client name.

  1. Create a class which defines the response model.
     public class SampleGetResponse
     {
         public int id { get; set; }
         public string name { get; set; }
         public string username { get; set; }
    }
  1. Create an object of type JingetServiceHandler<> class and pass the response model as its generic type, or Create an object of type JingetServiceHandler class:
var jingetServiceHandler = new JingetServiceHandler<SampleGetResponse>(serviceProvider, "https://jsonplaceholder.typicode.com");
  1. Call your endpoint:
var result = await jingetServiceHandler.GetAsync("users");

How to call SOAP web Services:

  1. For SOAP services, it would be important to create the request envelope before sending the request. To create the request envelop, You need to create classes for different parts of the request envelop. For example suppose that we need to model the following request envelop:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:Add>
         <tem:intA>?</tem:intA>
         <tem:intB>?</tem:intB>
      </tem:Add>
   </soapenv:Body>
</soapenv:Envelope>

In this request envelop we have Envelop node which contains two inner nodes: Header and Body. Also for Body, this node contains a node node called Add and finally Add contains two nodes called intA and intB. Also each node belongs to some namespaces which are defined in Envelop node. With all these in mind, we need to define classes for exact this hierarchy as follow:

//This is the whole request envelop
public class SampleSOAPRequest : SOAPRequestBase<SampleSOAPRequest.Envelope, SampleSOAPRequest.SampleSOAPGet>
{
    //This method creates an envelop with the following structure
    public override (Envelope envelope, SampleSOAPGet request) CreateEnvelope()
    {
        var envelope = new Envelope
        {
            Header = new EnvelopeHeader(),
            Body = new EnvelopeBody()
        };
        return (envelope, envelope.Body.Add);
    }

    //request envelop contains the Envelop node with some namespaces
    [Serializable, XmlType(Namespace = "http://schemas.xmlsoap.org/soap/envelope/"), XmlRoot(Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]
    public class Envelope : SOAPEnvelopeBase
    {
	    //When calling this method, the final envelop is returned as string value
        public override string ToString()
        {
            XmlSerializerNamespaces ns = new();
            ns.Add("tem", "http://tempuri.org/");
            ns.Add("soapenv", "http://schemas.xmlsoap.org/soap/envelope/");

            return XmlUtility.SerializeToXml(this, true, ns);
        }

        //Envelop node contains the Header node
        public EnvelopeHeader Header { get; set; }

        //Envelop node contains the Body node
        public EnvelopeBody Body { get; set; }
    }

    //The Header node has the following members. As you see it is empty. Also this node belongs to the http://schemas.xmlsoap.org/soap/envelope/ namespace
    [Serializable, XmlType(Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]
    public class EnvelopeHeader
    {

    }

      //The Body node has the following members. Also this node belongs to the http://schemas.xmlsoap.org/soap/envelope/ namespace
    [Serializable, XmlType(Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]
    public class EnvelopeBody
    {
	    //Body node contains a node called 'Add' which belongs to the http://schemas.xmlsoap.org/soap/envelope/ namespace
        [XmlElement(Namespace = "http://tempuri.org/")]
        public SampleSOAPGet Add { get; set; }
    }

     //The Add node has the following members.
    [Serializable]
    public class SampleSOAPGet
    {
        public int intA { get; set; }
        public int intB { get; set; }
    }
}
  1. Now that we have our envelop, we can easily call the SOAP web service as following:
var (envelope, request) = new SampleSOAPRequest().CreateEnvelope();
envelope.Body.Add = new SampleSOAPRequest.SampleSOAPGet { intA = 1, intB = 2 };

 var jingetServiceHandler = new JingetServiceHandler<ResponseType>("http://www.dneonline.com/calculator.asmx");

 var result = await jingetServiceHandler.PostAsync("", envelope.ToString(), true, new Dictionary<string, string>
 {
              {"Content-Type","text/xml" },
              {"SOAPAction","http://tempuri.org/Add" }
 });

In line number 2, we have our envelop and all we need to do, is to pass our parameters. In line number 6, the envelop is being send to the PostAsync method as string value. It is important to note the SOAPAction header.


How to use custom Service Handler

You can use your custom service handler instead of using JingetServiceHandler. To do this create your custom class and makes it to inherit from ServiceHandler<> or ServiceHandler class. Also create a custom class for your event management and pass it as generic argument to ServiceHandler<> class. You can also make use of ServiceHandler(non generic class) too. Different between these two class is that ServiceHandler does not provide any event for response deserialization. it returns the raw response and deserialization is up to you. For example suppose that we have a class called CustomHandler as below:

    public class CustomServiceHandler : ServiceHandler<CustomEvents>
    {
        ...
    }

or

    public class CustomServiceHandler(string baseUri, bool ignoreSslErrors = false) : JingetServiceHandler(baseUri, ignoreSslErrors)
    {
        ...
    }

How to install

In order to install Jinget please refer to nuget.org

Further Information

Sample codes are available via Unit Test projects which are provided beside the main source codes.

Contact Me

👨‍💻 Twitter: https://twitter.com/_jinget

📧 Email: farahmandian2011@gmail.com

📣 Instagram: https://www.instagram.com/vahidfarahmandian

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Jinget.Handlers.ExternalServiceHandlers:

Package Downloads
Jinget.AzureDevOps.Connector

Using this package, you can easily connect to Azure DevOps and integrate it with your software applications

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.0.50 27 9/11/2025
8.0.49 55 9/8/2025
8.0.48 47 9/8/2025
8.0.47 61 9/7/2025
8.0.46 85 8/22/2025
8.0.45 124 7/31/2025
8.0.44 100 7/31/2025
8.0.43 97 7/30/2025
8.0.42 100 7/30/2025
8.0.41 98 7/30/2025
8.0.40 100 7/30/2025
8.0.39 104 7/29/2025
8.0.38 97 7/28/2025
8.0.37 100 7/28/2025
8.0.36 108 7/28/2025
8.0.36-preview005 106 7/27/2025
8.0.35 79 7/19/2025
8.0.34 78 7/18/2025
8.0.33 161 6/29/2025
8.0.32 151 6/29/2025
8.0.31 102 6/28/2025
8.0.30 71 6/27/2025
8.0.29 74 6/27/2025
8.0.28 79 6/27/2025
8.0.27 102 6/27/2025
8.0.26 122 6/21/2025
8.0.25 168 6/15/2025
8.0.25-preview001 146 6/15/2025
8.0.24 129 5/31/2025
8.0.23 155 5/28/2025
8.0.23-preview001 146 5/28/2025
8.0.22 164 5/25/2025
8.0.21 160 5/11/2025
8.0.20 148 5/11/2025
8.0.19 154 5/11/2025
8.0.18 184 4/21/2025
8.0.17 182 4/21/2025
8.0.16 119 4/19/2025
8.0.15 224 4/13/2025
8.0.14 198 4/7/2025
8.0.13 186 4/7/2025
8.0.12 127 4/5/2025
8.0.11 227 3/9/2025
8.0.10 196 3/9/2025
8.0.9 203 3/9/2025
8.0.8 181 2/27/2025
8.0.7 134 2/27/2025
8.0.6 129 2/27/2025
8.0.5 139 2/26/2025
8.0.4 135 2/25/2025
8.0.3 137 2/24/2025
8.0.2 133 2/24/2025
8.0.1 131 2/20/2025
8.0.0 136 1/22/2025
8.0.0-preview013 104 12/19/2024
8.0.0-preview012 111 12/19/2024
8.0.0-preview011 111 12/17/2024
8.0.0-preview010 116 12/16/2024
8.0.0-preview009 104 12/15/2024
8.0.0-preview008 99 11/25/2024
8.0.0-preview007 119 11/11/2024
8.0.0-preview006 108 11/2/2024
8.0.0-preview005 101 11/2/2024
8.0.0-preview004 115 11/1/2024
8.0.0-preview003 107 11/1/2024
8.0.0-preview002 103 11/1/2024
8.0.0-preview001 98 11/1/2024
6.2.23-preview003 107 10/31/2024
6.2.23-preview002 104 10/31/2024
6.2.22 148 10/26/2024
6.2.21 131 10/26/2024
6.2.20 130 10/26/2024
6.2.19-preview037 106 10/14/2024
6.2.19-preview036 106 9/30/2024
6.2.19-preview035 129 9/10/2024
6.2.19-preview034 122 9/9/2024
6.2.19-preview033 118 9/1/2024
6.2.19-preview032 114 9/1/2024
6.2.19-preview031 121 8/31/2024
6.2.19-preview029 118 8/26/2024
6.2.19-preview028 133 8/26/2024
6.2.19-preview027 138 8/26/2024
6.2.19-preview026 141 8/21/2024
6.2.19-preview025 142 8/21/2024
6.2.19-preview024 139 8/19/2024
6.2.19-preview023 122 8/8/2024
6.2.19-preview022 119 8/8/2024
6.2.19-preview021 116 8/5/2024
6.2.19-preview020 125 8/5/2024
6.2.19-preview019 112 8/5/2024
6.2.19-preview018 82 8/3/2024
6.2.19-preview017 80 7/30/2024
6.2.19-preview016 92 7/29/2024
6.2.19-preview015 92 7/29/2024
6.2.19-preview014 97 7/26/2024
6.2.19-preview013 122 7/20/2024
6.2.19-preview012 109 7/20/2024
6.2.19-preview011 118 6/15/2024
6.2.19-preview010 116 6/14/2024
6.2.19-preview009 113 6/14/2024
6.2.19-preview008 117 6/13/2024
6.2.19-preview007 113 6/13/2024
6.2.19-preview006 108 6/13/2024
6.2.19-preview005 96 6/13/2024
6.2.19-preview004 106 6/13/2024
6.2.19-preview003 119 6/11/2024
6.2.19-preview002 127 6/8/2024
6.2.19-preview001 124 6/8/2024
6.2.18 162 6/6/2024
6.2.18-preview020 129 6/6/2024
6.2.18-preview019 136 6/6/2024
6.2.18-preview018 157 6/6/2024
6.2.18-preview017 132 6/2/2024
6.2.18-preview016 131 6/1/2024
6.2.18-preview015 139 5/28/2024
6.2.18-preview014 126 5/28/2024
6.2.18-preview013 130 5/28/2024
6.2.18-preview012 125 5/28/2024
6.2.18-preview011 119 5/26/2024
6.2.18-preview010 125 5/26/2024
6.2.18-preview009 121 5/26/2024
6.2.18-preview008 131 5/26/2024
6.2.18-preview007 132 5/22/2024
6.2.18-preview006 135 5/22/2024
6.2.18-preview005 115 5/19/2024
6.2.18-preview004 108 5/19/2024
6.2.18-preview003 104 5/19/2024
6.2.18-preview002 106 5/19/2024
6.2.17 120 5/19/2024
6.2.16 124 5/18/2024
6.2.15 132 5/18/2024
6.2.14 126 5/18/2024
6.2.13 136 5/17/2024
6.2.12 132 5/17/2024
6.2.11 135 5/17/2024
6.2.10 143 5/17/2024
6.2.9 157 5/12/2024
6.2.8 163 5/9/2024
6.2.7 169 5/9/2024
6.2.6 167 5/7/2024
6.2.5 148 4/24/2024
6.2.4 181 2/1/2024
6.2.3 155 2/1/2024
6.2.2 149 1/31/2024
6.2.1 164 1/23/2024
6.2.0 162 1/23/2024
6.2.0-preview013 131 1/19/2024
6.2.0-preview012 136 1/19/2024
6.2.0-preview011 140 1/18/2024
6.2.0-preview010 144 1/14/2024
6.2.0-preview009 150 1/11/2024
6.2.0-preview008 159 1/1/2024
6.2.0-preview007 142 1/1/2024
6.2.0-preview006 146 1/1/2024
6.2.0-preview005 153 1/1/2024
6.2.0-preview001 149 12/30/2023
6.1.0 253 12/2/2023
6.1.0-preview003 171 12/2/2023
6.1.0-preview002 166 12/2/2023
6.1.0-preview001 169 12/2/2023
6.0.2 183 11/27/2023
6.0.1 196 11/22/2023
6.0.0 166 11/22/2023
3.5.0 232 10/28/2023
3.4.0 239 10/1/2023
3.3.1 222 9/30/2023
3.3.0 198 9/28/2023
3.2.5 210 9/28/2023
3.2.4 214 9/28/2023
3.2.3 203 9/28/2023
3.2.2 210 9/28/2023
3.2.1 188 9/28/2023
3.2.0 210 9/28/2023
3.1.0 216 9/27/2023
3.0.1 197 9/27/2023
3.0.0 219 9/14/2023
3.0.0-preview001 195 9/14/2023
2.3.2 237 9/12/2023
2.3.1 292 8/20/2023
2.3.0 275 8/20/2023
2.2.0 259 8/12/2023
2.1.1 298 8/5/2023
2.1.0 271 8/5/2023
2.0.5 251 7/20/2023
2.0.4 260 7/15/2023
2.0.3 699 7/1/2023
2.0.1 265 7/1/2023
2.0.0 297 6/29/2023