我有一些.Net 4.8 C#代码,它从SOAP Web服务读取WSDL,并动态生成用于调用该服务提供的方法的UI。我使用诸如ServiceDescription,MetadataSection,ServiceContractGenerator之类的System.Web.Services类来执行此操作。代码看起来像这样:
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();
我想将此代码移植到.Net Core 3.0,但无法弄清楚如何移动使用System.Web.Services类的代码。据我所知,.Net Core不支持System.Web.Services类,但在Microsoft.AspNet包中找不到功能等效的类。所以我的问题是: