C
C#9mo ago
Apache

Migrating WSDL imports via ServiceDescriptionImporter from Framework to Core

I'm writing documentation website for a backwards compatible API. I'm migrating code from .NET Framework 4.7.2, to .NET8. In net472, we get the results of any given WSDL URL, read it into a System.Web.Services.Description.ServiceDescription, check if there are any warnings with a System.Web.Services.Description.ServiceDescriptionImporter, create an assembly in memory, with Microsoft.CSharp.CSharpCodeProvider, and then read the System.Type from the assembly via reflection. A lot of this has been ripped out of BCL in Core. Both SOAP and WCF are both depreciated, but a lot of our clients still use the SOAP services on legacy projects; so we need to keep them up, and documented. But, we also need to move on tech-stack wise. So, I'm wondering what the options are. Ideally, some wonderful person will have created a NuGet library that would wrap all of this up, and make it all magically work within net8.0. But, failing the coming of a saviour, how else would it be possible to programmatically resolve a System.Type from any given WSDL URL?
9 Replies
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
Apache
ApacheOP9mo ago
The services themselves are not being touched. All I'm doing is migrating the API reference docs, from Umbraco, to OrchardCore, with a Blazor de-coupled front-end.
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
Apache
ApacheOP9mo ago
The reference docs have code samples, and live demos. The live demos can use REST, that's fine.
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
Apache
ApacheOP9mo ago
But the code samples are programmatically built from the SOAP objects. There's a System.Web.Services.Description NuGet package, but it doesn't contain ServiceDescriptionImporter, only ServiceDescription.
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
reflectronic
reflectronic9mo ago
so… the code for ServiceDescriptionImporter is online and licensed appropriately for use https://github.com/microsoft/referencesource/blob/master/System.Web.Services/System/Web/Services/Description/ServiceDescriptionImporter.cs i haven’t looked to see how much the implementation relies on internal classes to WCF if it doesn’t, then you can just copy it into your project if it does, you’ll have to fork WCF, add the code in, and build a private version of System.ServiceModel.* to use
Apache
ApacheOP9mo ago
The answer to this question is pretty much exactly what we are doing now, and need to move away from: https://stackoverflow.com/questions/38482849/generating-proxy-class-from-wsdl-on-the-fly
Stack Overflow
Generating proxy class from WSDL on the fly?
I'm currently working a Windows Service which when started takes a load of scripts and compiles them for running on a schedule, however some of these scripts need to access ASMX web services. My
Want results from more Discord servers?
Add your server