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.71k stars 559 forks source link

StackOverFlowException to generate web service client with Microsoft WCF Web Service Reference Provider (chameleon schemas with cyclic includes) #3149

Closed Sebacad closed 6 years ago

Sebacad commented 6 years ago

I have the following error using last Microsoft WCF Web Service Reference Provider:

dotnet svcutil GestionDossierPatientPartage.wsdl Outil de génération de proxy du modèle de service Microsoft (R) WCF pour plateforme .Net Core [dotnet-svcutil, version 1.0.3] Copyright (c) Microsoft Corporation. Tous droits réservés. Tentative de chargement des métadonnées à partir de 'GestionDossierPatientPartage.wsdl'.

Process is terminating due to StackOverflowException.

thank for helping me!

Sebacad commented 6 years ago

wcf.zip Here the WSDL with the error

mlacouture commented 6 years ago

Hi @Sebacad

Thank you for reporting this issue and for providing the wsdl files for investigation.

You are hitting this problem because the schema documents have cyclic includes (datatypes-base.xsd -> voc.xsd -> datatypes.xsd -> datatypes-base.xsd).

However, I think the WCF Web Service Reference provider should be able to handle this situation. We'll consider a fix for a future release.

Sebacad commented 6 years ago

Thanks @mlacouture

Do you know the delay of the future release with the fix? For now, I try to generate reference by hand using the reference generated with the .Net framework and applying the differences of the .Net Core Framework

Good alternative for you?

Thanks,

mlacouture commented 6 years ago

Hi @Sebacad We plan to make a fix for this issue available with the next release of the dotnet-svcutil tool in a few weeks. As per the WCF Web Service Reference tool the fix will be available in Visual Studio 2017 v16.0.

The workaround you are using looks good to me. As an alternative, you could fix up the WSDL by removing the cyclic references.

Sebacad commented 6 years ago

Hi @mlacouture

I have removed the cyclic references. Its Perfect! Just for information. The WSDL is an export, so the endpoint URI is empty

`

        </port>`

I get the following error

Erreur : URI non valide : L'URI est vide. XPath vers la source de l'erreur : //wsdl:definitions[@targetNamespace='asip:ci-sis:gdp:2010']/wsdl:service[@name='GDP_Service']/wsdl:port[@name='GDP_Binding_Soap12']

Maybe no generate error if URI empty

Sebacad commented 6 years ago

So I solved my problem. Thanks for your help!

mlacouture commented 6 years ago

Thank you @Sebacad for the update. I will be providing a fix for this issue in a future release.

dasetser commented 6 years ago

The fix for this is included in dotnet-svcutil v1.0.4, which is now released. The fix will be included in the WCF Web Service Reference Provider as part of Visual Studio 2019.