VanaCosmin.WCF.WebExtensions 1.0.0

.NET Framework 3.5
There is a newer version of this package available.
See the version list below for details.
Install-Package VanaCosmin.WCF.WebExtensions -Version 1.0.0
dotnet add package VanaCosmin.WCF.WebExtensions --version 1.0.0
<PackageReference Include="VanaCosmin.WCF.WebExtensions" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add VanaCosmin.WCF.WebExtensions --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: VanaCosmin.WCF.WebExtensions, 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 VanaCosmin.WCF.WebExtensions as a Cake Addin
#addin nuget:?package=VanaCosmin.WCF.WebExtensions&version=1.0.0

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

WCF Web Extensions

Nuget package which enhances WCF REST with functionalities like optional query parameters, http headers or multipart requests.

Roadmap:

  • Version 1.0: Allow client to send optional query string parameters (available)
  • Version 1.1: Allow client-server to use optional query string parameters in method parameters, instead of using WebOperationContext class, so that the parameters are at method level, not channel level
  • Version 1.2: Allow client to send custom HTTP headers
  • Version 1.3: Allow multipart/form-data requests in both client and server in a typed manner

How to use:

For code snippets and documentation, visit the official page

Dillinger is a cloud-enabled, mobile-ready, offline-storage, AngularJS powered HTML5 Markdown editor.

Sample client-side code

using System.ServiceModel;
using System.ServiceModel.Web;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using VanaCosmin.WCF.WebExtensions.QueryParameters;
using VanaCosmin.WCF.WebExtensions.Test.TestService;
using VanaCosmin.WCF.WebExtensions.ClientExtensions;

namespace VanaCosmin.WCF.WebExtensions.Test
{
    public class QueryParametersClient
    {
        const string ServiceUri = "http://localhost:7777/TestService";

        public void CallService()
        {
            using (var factory = new WebChannelFactory<IQueryParametersTestService>(new WebHttpBinding()))
            {
                factory.Endpoint.Address = new EndpointAddress(ServiceUri);
                factory.Endpoint.EndpointBehaviors.Add(new QueryParametersServiceBehavior());
                using (var client = factory.CreateWebChannel())
                {
                    client.AddQueryParameter("format", "xml");
                    client.AddQueryParameter("version", "2");
                    var result = client.Channel.GetReport();
                }
            }
        }
    }
}

Sample server side code

var queryParameters = WebOperationContext.Current.IncomingRequest.UriTemplateMatch.QueryParameters;
Product Versions
.NET Framework net35 net40 net403 net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

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.1.0 512 12/20/2018
1.0.0 434 11/13/2018

Version 1.0: Allow client to send optional query string parameters