Any .svc SOAP call under protocol WcfSoapWithOpenIdConnect and deprecated WcfSoapWithWsTrust will do HTTP requests where the result from the SOAP web services is expected to be compressed which greatly saves transfer times on virtually longer network cables. Currently an OpenAPI REST call returns an uncompressed JSON model which can be 98072 bytes, while gzip compressed it is 11564.
This issue is about enabling this for the non-soap HTTP calls, in particular
- While discovering the web services over
connectionconfiguration.xml
- While using protocol
OpenApiWithOpenIdConnect which are using an HttpClient with bearer token, available under $ishSession.OpenApiISH30Client
Do note that even though the client requests this encoding, it still is up to the server to support or eventually do the encoding.
- ISHRemote under Windows PowerShell 5.1 hosted on .NET Framework 4.8 only supports
gzip and deflate.
- Cross-platform PowerShell 7.x hosted on .NET 6+ additionally supports
br (Brotli).
- Future PowerShell 7.7 hosted on .NET11 holds Add DecompressionMethods.Zstandard for HTTP automatic decompression by Copilot · Pull Request #123531 · dotnet/runtime
Given that the release of v8.2 is due soon, await to push this change for early v8.3 to offer some stabilization.
Actions...
Expected code change...
#if NET48
handler.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
#else
handler.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate | DecompressionMethods.Brotli;
#endif
_httpClient = new HttpClient(handler)
{
Timeout = _timeout
};
#if NET48
_httpClient.DefaultRequestHeaders.AcceptEncoding.ParseAdd("gzip");
_httpClient.DefaultRequestHeaders.AcceptEncoding.ParseAdd("deflate");
#else
_httpClient.DefaultRequestHeaders.AcceptEncoding.ParseAdd("gzip");
_httpClient.DefaultRequestHeaders.AcceptEncoding.ParseAdd("deflate");
_httpClient.DefaultRequestHeaders.AcceptEncoding.ParseAdd("br");
#endif
Any
.svcSOAP call under protocolWcfSoapWithOpenIdConnectand deprecatedWcfSoapWithWsTrustwill do HTTP requests where the result from the SOAP web services is expected to be compressed which greatly saves transfer times on virtually longer network cables. Currently an OpenAPI REST call returns an uncompressed JSON model which can be 98072 bytes, whilegzipcompressed it is11564.This issue is about enabling this for the non-soap HTTP calls, in particular
connectionconfiguration.xmlOpenApiWithOpenIdConnectwhich are using anHttpClientwith bearer token, available under$ishSession.OpenApiISH30ClientDo note that even though the client requests this encoding, it still is up to the server to support or eventually do the encoding.
gzipanddeflate.br(Brotli).Given that the release of v8.2 is due soon, await to push this change for early v8.3 to offer some stabilization.
Actions...
IshSession.csInfoShareWcfSoapWithOpenIdConnectConnection.csInfoShareWcfSoapWithWsTrustConnection.cs, although deprecated for consistency.Expected code change...