Ticket T736928
Visible to All Users

WCF client in .NET Core

created 6 years ago

[DevExpress Support Team: CLONED FROM XPO – 11.1 Sneak Peek - WCF services for IDataStore ]
Hi, Dennis,
We have built our application using XPO that consuming the DataStore WCF service。But I found that ,  connectionString in method  <string connectionString, AutoCreateOption defaultAutoCreateOption) (version 18.2)> does not support WCF svc URI any more in .net core。So we can not extend  our application using the current DAL infrustructure for .net core apps.
Do you have the plan to support WCF datastore in .netcore that shall make users extend app in .net core  easily, or  they must rewrite the whole DAL code for .net core apps?
I do think it is a big problem if XPO do not support WCF Datastore client in .netcore.

Answers approved by DevExpress Support

created 6 years ago

Hello,

DataStoreClient, CachedDataStoreClient, and their async versions are supported in client .NET Core apps (for instance, Xamarin).
We have just cut off the methods used to automatically create these IDataStore objects from a connection string:

C#
//DevExpress.Xpo\XpoDefault.cs #if !DXPORTABLE && !DXCORE3 static IDataStore CreateWCFWebServiceStore(string connectionString) { EndpointAddress address = new EndpointAddress(connectionString); BasicHttpBinding binding = new BasicHttpBinding(); if(!string.IsNullOrEmpty(connectionString) && connectionString.StartsWith("https://")) { binding.Security.Mode = BasicHttpSecurityMode.Transport; } binding.MaxReceivedMessageSize = Int32.MaxValue; binding.ReaderQuotas.MaxArrayLength = Int32.MaxValue; binding.ReaderQuotas.MaxDepth = Int32.MaxValue; binding.ReaderQuotas.MaxBytesPerRead = Int32.MaxValue; binding.ReaderQuotas.MaxStringContentLength = Int32.MaxValue; return CreateWcfServiceStore(connectionString, address, binding); } ...

The only reason for this is not to add extra dependencies required to create bindings. For instance, BasicHttpBinding requires https://www.nuget.org/packages/System.ServiceModel.Http/; other bindings require other Nuget packages.
XPO developers can create and configure DataStoreClient and other XPO APIs as well as standard bindings in their client apps manually.

The only limitation is about the WCF hosting, because .NET Core itself does not support the ServiceHost API (this is out of our control, though):
    https://github.com/dotnet/wcf/issues/2559
    https://github.com/dotnet/wcf/issues/1200#issuecomment-356422289

XPO developers can still host their data services under the full .NET Framework and have .NET Core-based clients as consumers.

Let me know if you require any further clarification.

    Comments (1)
    Andrey K (DevExpress Support) 5 years ago

      Hello,

      XAF v19.2.4+ allows you to use Middle Tier Security client-related classes (WcfSecuredClient, MiddleTierServerObjectSpaceProvider and MiddleTierClientSecurity) in .NET Standard 2.0/.NET Core projects. You can connect a .NET Core client application to a .NET Framework WCF server only (due to .NET Core platform limitations).

      Thanks,
      Andrey

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.