dotnet / wcf

This repo contains the client-oriented WCF libraries that enable applications built on .NET Core to communicate with WCF services.
MIT License
1.69k stars 556 forks source link

WCF Web Service Reference Provider Tool Class Generation #3512

Open RealDotNetDave opened 5 years ago

RealDotNetDave commented 5 years ago

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.

Lxiamail commented 5 years ago

@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?

RealDotNetDave commented 4 years ago

Yes. My goal would be:

  1. Allow the generation of data (model) classes only. Preferably in separate .cs files.
  2. 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?

arizonawayfarer commented 4 years ago

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.

Dusthorn commented 4 years ago

Agree. Also have million lines file(

dasetser commented 4 years ago

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).

bstordrup commented 4 years ago

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.

RealDotNetDave commented 3 years ago

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.

rserj commented 3 years ago

Hello all, may I wonder if there any updates on this issue?

RealDotNetDave commented 3 years ago

I have not heard anything.

wildmichael commented 3 years ago

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:

Right now I'll resort to manually trimming down the WSDL to the portions I need and see where that gets me.

LucFauvel commented 2 years ago

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.

ferrarimartin commented 1 year ago

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.

CNBoland commented 1 year ago

Edit > Outlining > Stop Outlining (Ctrl+M, Ctrl+P) on the generated file seems to help with VS performance.

cihanuygun commented 7 months ago

I have come accross with that issue upon wsdl code generation requirement come across in our project. You may use https://marketplace.visualstudio.com/items?itemName=OlegShilo.MoveTypeToFile to split single file to independent class files. That may help about this issue until tool provide built-in solution. It has a feature to split single file to classes.