[BUG] - WSDL containing multiple endpoints (wsdl:port) fails to deploy
Release version
v4.10.3
Describe the bug
If an APIM instance has multiple custom domain gateways defined the Specification.WSDL file that is extracted as part of the APIOps will contain multiple endpoints. When the APIOps attempts to publish the API it fails with an error "Multiple service endpoints available, only one can be imported at a time".
Note: If I manually import that WSDL in the APIM console it will prompt me to select one of the service endpoints and then once selected it will successfully import.
If I remove the second endpoint (the wsdl:port) from the Specification.wsdl the publish will be successful.
This is a sample from the wsdl:
<wsdl:service name="Sample-Web-Service">
<wsdl:port name="Sample-Web-Service-1" binding="tns:Sample-Web-Service">
Please see the Actual behavior section for the error that is generated.
Thanks very much for any assistance.
Expected behavior
The same specification.wsdl that is exported should successfully import.
Actual behavior
The publish using a specification.wsdl that contained multiple endpoints fails:
2023-11-27T16:43:33.3150772Z System.Net.Http.HttpRequestException: HTTP request to URI https://management.azure.com/subscriptions/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xx-xx-xxxxx-xx-xxxxxxxxx/providers/Microsoft.ApiManagement/service/xxxxxxxxxxx/apis/xxxxxxxxxxxx?api-version=2022-04-01-preview&import=true failed with status code 400. Content is '{"error": {"code":"ValidationError","message":"One or more fields contain incorrect values:","details": [ {"code":"ValidationError","target":"representation","message":"Parsing error(s): Multiple service endpoints available, only one can be imported at a time"}, {"code":"ValidationError","target":"representation","message":"Parsing error(s): {"events":[{"level":"Informational","event":"ParsingXMLStarted","message":"Started parsing XML"}, {"level":"Informational","event":"ParsingXMLComplete","message":"Completed parsing XML"}, {"level":"Verbose","event":"WsdlImportRuleVerifyWadl11Schema","message":"WSDL validated against XML Schema"}, {"level":"Informational","event":"WsdlPrecheckComplete","message":"Completed WSDL verification. WSDL is considered valid."}, {"level":"Informational","event":"WsdlParsingStarted","message":"Service : Endpoint : "}, {"level":"Informational","event":"WsdlIdentification","message":"WsdlVersion: 'Wsdl11' TargetNamespace: 'http://ACORD.org/Standards/Life/2'."}, {"level":"Informational","event":"LoadedSchema","message":"Target Namespace: 'http://ACORD.org/Standards/Life/2'."}, {"level":"Informational","event":"LoadedSchemas","message":"Loaded '1' schemas."}, {"level":"Informational","event":"LoadedTypes","message":"Loaded '2' types."}, {"level":"Informational","event":"LoadedMessages","message":"Loaded '2' messages."}, {"level":"Informational","event":"LoadedInterfaces","message":"Loaded '1' interfaces."}, {"level":"Informational","event":"LoadedBindings","message":"Loaded '1' bindings."}, {"level":"Informational","event":"LoadedServices","message":"Loaded '1' services."}, {"level":"Informational","event":"WsdlParsingComplete","message":"Parsed 1 operations and 2 messages "}]}"}]}}'.
Reproduction Steps
From an APIM instance that has multiple custom gateway domains configured export a soap API. The exported WSDL will contain multiple wsdl:port instances.
Try to publish that same API to another APIM instance to generate the problem.
Thank you for opening this issue! Please be patient while we will look into it and get back to you as this is an open source project. In the meantime make sure you take a look at the [closed issues](https://github.com/Azure/apiops/issues?q=is%3Aissue+is%3Aclosed) in case your question has already been answered. Don't forget to provide any additional information if needed (e.g. scrubbed logs, detailed feature requests,etc.).
Whenever it's feasible, please don't hesitate to send a Pull Request (PR) our way. We'd greatly appreciate it, and we'll gladly assess and incorporate your changes.
We currently don't have bandwidth to look into this issue. Anyway you can take a look at the extractor code dealing with this use case and submit a PR?
I'll take a look. Thanks
From: Wael Kdouh @.> Sent: Thursday, November 30, 2023 2:58 PM To: Azure/apiops @.> Cc: Ian Reid @.>; Author @.> Subject: Re: [Azure/apiops] [BUG] - WSDL containing multiple endpoints (wsdl:port) fails to deploy (Issue #428)
You don't often get email from @.@.>. Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification CAUTION: This email originated from outside of Equitable Life. Do not click links or open attachments unless you recognize the sender and know the content is safe.
We currently don't have bandwidth to look into this issue. Anyway you can take a look at the extractor code dealing with this use case and submit a PR?
Reply to this email directly, view it on GitHubhttps://github.com/Azure/apiops/issues/428#issuecomment-1834456332, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BELVFZUIMI7RYU6LC3NCNOLYHDQLPAVCNFSM6AAAAABABXKFASVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZUGQ2TMMZTGI. You are receiving this because you authored the thread.Message ID: @.@.>>
IMPORTANT NOTICE: Internet may be vulnerable to interception. Equitable Life cannot ensure privacy or authenticity of information sent via internet, and is not responsible for any damages you incur by sending confidential or personal information to us or by sending such information to you at your request. This e-mail and any attachments are confidential, may be covered by privilege or exempt from disclosure under applicable law, and are intended for the addressee only. If you are not the intended recipient, you must not disclose, copy, distribute or retain any or part of this e-mail and any attachments without written permission of The Equitable Life Insurance Company of Canada.
AVIS IMPORTANT : L'Internet est susceptible ? l'interception. L'Assurance vie ?quitable ne peut garantir le droit ? la vie priv?e et l'authenticit? des renseignements envoy?s par l'entremise de l'Internet, et elle n'est pas responsable de tout dommage que vous pourriez subir en nous envoyant vos renseignements personnels ou confidentiels ou si nous vous envoyons de tels renseignements ? la suite de votre demande. Ce courriel et ses pi?ces jointes sont confidentiels, et peuvent ?tre prot?g?s par une clause de non-divulgation selon la loi applicable, et s'adressent ? la destinataire ou au destinataire seulement. Si vous n'?tes pas le destinataire vis? de ce courriel et de ses pi?ces jointes, vous ne devez pas les divulguer, les copier, les distribuer ou les conserver en tout ou en partie sans la permission ?crite de L'?quitable, compagnie d'assurance vie du Canada.
This is an apim limitation. We can't do anything from the apiops side.
We ended up adding a step in the extract pipeline to remove N - 1 endpoints leaving only one endpoint within the wsdl before adding it to auto generated branch.
From: Wael Kdouh @.> Sent: Friday, July 5, 2024 11:47 AM To: Azure/apiops @.> Cc: Ian Reid @.>; Author @.> Subject: Re: [Azure/apiops] [BUG] - WSDL containing multiple endpoints (wsdl:port) fails to deploy (Issue #428)
You don't often get email from @.@.>. Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification CAUTION: This email originated from outside of Equitable Life. Do not click links or open attachments unless you recognize the sender and know the content is safe.
This is an apim limitation. We can't do anything from the apiops side.
Reply to this email directly, view it on GitHubhttps://github.com/Azure/apiops/issues/428#issuecomment-2211094002, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BELVFZR2WBQWCLJAUV7RE7LZK25VXAVCNFSM6AAAAABKNNLY2SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJRGA4TIMBQGI. You are receiving this because you authored the thread.Message ID: @.@.>>
IMPORTANT NOTICE: Internet may be vulnerable to interception. Equitable Life cannot ensure privacy or authenticity of information sent via internet, and is not responsible for any damages you incur by sending confidential or personal information to us or by sending such information to you at your request. This e-mail and any attachments are confidential, may be covered by privilege or exempt from disclosure under applicable law, and are intended for the addressee only. If you are not the intended recipient, you must not disclose, copy, distribute or retain any or part of this e-mail and any attachments without written permission of The Equitable Life Insurance Company of Canada.
AVIS IMPORTANT : L'Internet est susceptible ? l'interception. L'Assurance vie ?quitable ne peut garantir le droit ? la vie priv?e et l'authenticit? des renseignements envoy?s par l'entremise de l'Internet, et elle n'est pas responsable de tout dommage que vous pourriez subir en nous envoyant vos renseignements personnels ou confidentiels ou si nous vous envoyons de tels renseignements ? la suite de votre demande. Ce courriel et ses pi?ces jointes sont confidentiels, et peuvent ?tre prot?g?s par une clause de non-divulgation selon la loi applicable, et s'adressent ? la destinataire ou au destinataire seulement. Si vous n'?tes pas le destinataire vis? de ce courriel et de ses pi?ces jointes, vous ne devez pas les divulguer, les copier, les distribuer ou les conserver en tout ou en partie sans la permission ?crite de L'?quitable, compagnie d'assurance vie du Canada.