Skip to content

Commit fbcef69

Browse files
Merge pull request #17 from Azure/soap-api-issues
Soap api issues
2 parents f53477e + 25e7890 commit fbcef69

6 files changed

Lines changed: 35 additions & 7 deletions

File tree

docs/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<img src="assets/images/apim-logo-transparent.png">
32

43
# Code Of Conduct
@@ -61,6 +60,9 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
6160
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
6261
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
6362

63+
# Supporting Tools
64+
While the APIOPs tool does not have built-in support for promoting the migration of the APIM Dev Portal, there is another tool available that offers such functionality. We suggest you explore that tool which can be found [here](https://github.com/seenu433/apim-dev-portal-migration).
65+
6466
# Trademarks
6567

6668
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft

docs/index.markdown

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<img src="assets/images/apim-logo-transparent.png">
32

43
# Code Of Conduct
@@ -57,6 +56,9 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
5756
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
5857
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
5958

59+
# Supporting Tools
60+
While the APIOPs tool does not have built-in support for promoting the migration of the APIM Dev Portal, there is another tool available that offers such functionality. We suggest you explore that tool which can be found [here](https://github.com/seenu433/apim-dev-portal-migration).
61+
6062
# Trademarks
6163

6264
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft

tools/code/publisher/Api.cs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using common;
2+
using Flurl;
23
using Microsoft.Extensions.Logging;
34
using Microsoft.OpenApi;
45
using Microsoft.OpenApi.Extensions;
@@ -269,8 +270,16 @@ private static async ValueTask PutApi(ApiName apiName, ApiInformationFile? apiIn
269270
logger.LogInformation("Putting API {apiName}...", apiName);
270271

271272
var apiUri = GetApiUri(apiName, serviceUri);
273+
var putUri = apiUri.Uri;
274+
275+
// For WSDL files, we need to set the import query parameter to true.
276+
if (specificationFile is ApiSpecificationFile.Wsdl)
277+
{
278+
putUri = putUri.SetQueryParam("import", "true").ToUri();
279+
}
280+
272281
var apiJson = await GetApiJson(apiName, apiInformationFile, specificationFile, configurationApiJson, cancellationToken);
273-
await putRestResource(apiUri.Uri, apiJson, cancellationToken);
282+
await putRestResource(putUri, apiJson, cancellationToken);
274283

275284
// Handle GraphQL specification
276285
if (specificationFile is ApiSpecificationFile.GraphQl graphQlSpecificationFile)
@@ -310,7 +319,7 @@ private static async ValueTask<JsonObject> GetApiJson(ApiName apiName, ApiInform
310319

311320
private static async ValueTask<JsonObject> GetApiSpecificationJson(ApiSpecificationFile specificationFile, CancellationToken cancellationToken)
312321
{
313-
return new JsonObject
322+
var json = new JsonObject
314323
{
315324
["properties"] = new JsonObject
316325
{
@@ -330,6 +339,13 @@ private static async ValueTask<JsonObject> GetApiSpecificationJson(ApiSpecificat
330339
}
331340
}
332341
};
342+
343+
if (specificationFile is ApiSpecificationFile.Wsdl)
344+
{
345+
json["properties"]!["apiType"] = "soap";
346+
}
347+
348+
return json;
333349
}
334350

335351
private static async ValueTask<string> GetOpenApiV3SpecificationText(ApiSpecificationFile.OpenApi openApiSpecificationFile)

tools/code/publisher/Product.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
using common;
22
using Microsoft.Extensions.Logging;
33
using MoreLinq;
4+
using System;
45
using System.Collections.Generic;
56
using System.IO;
67
using System.Linq;
78
using System.Text.Json.Nodes;
89
using System.Threading;
910
using System.Threading.Tasks;
10-
11+
using System.Web;
12+
1113
namespace publisher;
1214

1315
internal static class Product
@@ -71,11 +73,15 @@ private static ProductName GetProductName(ProductInformationFile file)
7173
}
7274

7375
private static async ValueTask Delete(ProductName productName, ServiceUri serviceUri, DeleteRestResource deleteRestResource, ILogger logger, CancellationToken cancellationToken)
74-
{
76+
{
7577
var uri = GetProductUri(productName, serviceUri);
7678

7779
logger.LogInformation("Deleting product {productName}...", productName);
78-
await deleteRestResource(uri.Uri, cancellationToken);
80+
var builder = new UriBuilder(uri.Uri);
81+
var query = HttpUtility.ParseQueryString(builder.Query);
82+
query["deleteSubscriptions"] = "true";
83+
builder.Query = query.ToString();
84+
await deleteRestResource(builder.Uri, cancellationToken);
7985
}
8086

8187
public static ProductUri GetProductUri(ProductName productName, ServiceUri serviceUri)

tools/code/publisher/ProductApi.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ await GetArtifactProductApis(files, configurationJson, serviceDirectory)
3030
var configurationArtifacts = GetConfigurationProductApis(configurationJson);
3131

3232
return GetProductApisFiles(files, serviceDirectory)
33+
.Where(file => File.Exists(file.Path.ToString()))
3334
.Select(file =>
3435
{
3536
var productName = GetProductName(file);

tools/code/publisher/ProductGroup.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ await GetArtifactProductGroups(files, configurationJson, serviceDirectory)
3030
var configurationArtifacts = GetConfigurationProductGroups(configurationJson);
3131

3232
return GetProductGroupsFiles(files, serviceDirectory)
33+
.Where(file => File.Exists(file.Path.ToString()))
3334
.Select(file =>
3435
{
3536
var productName = GetProductName(file);

0 commit comments

Comments
 (0)