VanaCosmin.WCF.WebExtensions 1.0.0

WCF Web Extensions

Enhances WCF REST with functionalities like optional query parameters, http headers or multipart requests.

Install-Package VanaCosmin.WCF.WebExtensions -Version 1.0.0
dotnet add package VanaCosmin.WCF.WebExtensions --version 1.0.0
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.

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;

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;

Release Notes

Version 1.0: Allow client to send optional query string parameters

Dependencies

This package has no dependencies.

Version History

Version Downloads Last updated
1.0.0 37 11/13/2018