wcf
wcf copied to clipboard
WCF Web Service Reference Provider Tool Class Generation
Can an option be added to this connected service to generate separate class files? We are using SalesForce WSDL that turns into a Reference.cs that is over 115K lines of code. Creates perf issues in VS trying to load this monster.
@RealDotNetDave Thank you for your feedback. We also received feedback (https://github.com/dotnet/wcf/issues/3224) about only generate contracts without client code. For your case, would only generate contracts without client code solve your problem?
Yes. My goal would be:
- Allow the generation of data (model) classes only. Preferably in separate .cs files.
- Allow the generation of SoapClient classes only. Preferably in separate .cs files.
I believe this is how old service utility worked. The way I architect assemblies (and talk a lot about this in conference sessions), the model classes and only model classes should be in one assembly. Then I put the context classes, in this case, SoapClient, in a separate assembly. This way any other assembly can use the models, including client apps. I do this exact same architecture for Entity Framework.
Make sense?
Can I just throw in my desire to have this feature?
Currently, generating a client from the Cisco AXL WSDL generates a file that's over a million lines long.
Agree. Also have million lines file(
We had another request for this feature in another issue, and there have been a couple more comments and reactions since we triaged this. Moving it to pri 2 instead of pri 3 so we can take that into consideration during the next release planning.
As an FYI in case anyone wants to contribute to this project and send a PR, the underlying tool that the WCF Web Service Reference provider is using is dotnet-svcutil, and we recently open sourced this tool in this repository (you can find the source here).
I was the one reporting the issue that @dasetser just mentioned. I generate the reference for a service that contains a lot of classes, and it produces a 216000+ lines of code file - which makes my Visual Studio 2019 crash silently (might be an extension to Visual Studio that runs out of memory). I would very much like to have an option to generate one file per class instead of piling it all up in the same code file.
I'm glad I'm not the only one having issues! I had to write a bat file to compile the DLL since opening the project in Visual Studio is impossible for most of the people on my team. Updating the WSDL is a game of will VS crash or not. Currently I am the only one in the team that can do it.
Hello all, may I wonder if there any updates on this issue?
I have not heard anything.
I just tried running svcutil
on the Cisco Unified Communication Manager (CUCM) AXLApi.wsdl. The resulting Reference.cs
is a whopping 1071455 lines. Yes, One. Million. Lines.
There really should be ways of:
- Splitting the output. I could imagine things like one file per class, maximum N files per class but keep below M lines, pattern rules for splitting, etc.
- Filtering (inclusion/exclusion) of operations.
Right now I'll resort to manually trimming down the WSDL to the portions I need and see where that gets me.
Seeing as this hasn't moved in 2y, I also would like to express my interest in getting this done, dealing with the VMware SDK and it generates a 1.6 million line file. This also makes the DLL I generate with this extremely slow to load JIT.
I'm facing the same issue. Generated Reference.cs file is > 1 million lines. This causes timeouts at runtime at the time of compiling the serializers. Also, dotnet-svcutil.xmlserializers runs out of memory, so it's not possible to generate the serializers at compile time, though this last part is maybe a separate problem.