Porting ServiceDescription code to .net Core

Viewed 1424

I have some .Net 4.8 C# code that reads in a WSDL from a SOAP Web service, and dynamically generates a UI for invoking methods provided by the service. I use the System.Web.Services classes such as ServiceDescription, MetadataSection, ServiceContractGenerator to do this. The code looks something like this:

System.Web.Services.Description.ServiceDescription serviceDescription
 = System.Web.Services.Description.ServiceDescription.Read(new XmlTextReader(new StringReader(m_ServiceDescriptor)));
MetadataSection
 section =
MetadataSection.CreateFromServiceDescription(serviceDescription);
MetadataSet metaDocs = new MetadataSet(new MetadataSection[] {section});
WsdlImporter importer = new WsdlImporter(metaDocs);
ServiceContractGenerator serviceContractGenerator = new
ServiceContractGenerator(); ServiceEndpointCollection
serviceEndpointCollection = importer.ImportAllEndpoints();

I want to port this code to .Net Core 3.0, but cannot work out how to move the code that uses the System.Web.Services classes. As far as I can work out, System.Web.Services classes are not supported in .Net Core, but I can't find functional equivalent classes in the Microsoft.AspNet packages. So my questions are:

  1. Is there some way to import the System.Web.Services classes into a .Net Core 3.0 application?
  2. If not, where do I find the classes that do the same thing in .Net Core 3.0? Are they somewhere in the Microsoft.AspNet packages?
1 Answers

This scenario is not supported in .NET Core (I'm one of the developers on the WCF code base). The source is MIT licensed and available here so you could try porting it yourself.

Related