wcf icon indicating copy to clipboard operation
wcf copied to clipboard

WCF Web Service Reference Provider Tool Class Generation

Open RealDotNetDave opened this issue 5 years ago • 14 comments

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 avatar Mar 29 '19 19:03 RealDotNetDave

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

Lxiamail avatar Apr 02 '19 20:04 Lxiamail

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?

RealDotNetDave avatar Dec 11 '19 19:12 RealDotNetDave

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.

arizonawayfarer avatar Mar 13 '20 23:03 arizonawayfarer

Agree. Also have million lines file(

Dusthorn avatar Apr 07 '20 15:04 Dusthorn

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

dasetser avatar Jun 15 '20 22:06 dasetser

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.

bstordrup avatar Jun 16 '20 06:06 bstordrup

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.

RealDotNetDave avatar Jul 30 '20 15:07 RealDotNetDave

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

rserj avatar Aug 24 '20 20:08 rserj

I have not heard anything.

RealDotNetDave avatar Sep 08 '20 17:09 RealDotNetDave

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.

wildmichael avatar Oct 02 '20 06:10 wildmichael

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.

LucFauvel avatar Apr 30 '22 16:04 LucFauvel

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.

ferrarimartin avatar Aug 14 '22 15:08 ferrarimartin