Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-jmattson committed Jan 19, 2024
1 parent 7aadc5c commit 3ff70a3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/TopoMojo.Api/appsettings.conf
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@

## keep idle hypervisor connection for some minutes before disconnecting
# Pod__KeepAliveMinutes = 10
# Pod__SendTimeoutSeconds = 60

## Support SDDC instance
## In AWS SDDC a MetadataUrl is used to fetch the ApiUrl
Expand Down
26 changes: 18 additions & 8 deletions src/TopoMojo.Hypervisor/vSphere/VimClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -858,14 +858,24 @@ private Task Connect()
_logger.LogDebug($"Instantiating client {_config.Host}...");

// VimPortTypeClient.GetDefaultBinding(); // hmm, static methods not available here
var binding = new BasicHttpBinding
{
MaxBufferSize = int.MaxValue,
ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max,
MaxReceivedMessageSize = int.MaxValue,
AllowCookies = true,
SendTimeout = new TimeSpan(0, 0, _config.SendTimeoutSeconds)
};
Binding binding = _config.Url.StartsWith("https:")
? new BasicHttpsBinding
{
MaxBufferSize = int.MaxValue,
ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max,
MaxReceivedMessageSize = int.MaxValue,
AllowCookies = true,
SendTimeout = new TimeSpan(0, 0, _config.SendTimeoutSeconds)
} as Binding
: new BasicHttpBinding
{
MaxBufferSize = int.MaxValue,
ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max,
MaxReceivedMessageSize = int.MaxValue,
AllowCookies = true,
SendTimeout = new TimeSpan(0, 0, _config.SendTimeoutSeconds)
} as Binding
;

var endpoint = new EndpointAddress(_config.Url);

Expand Down

0 comments on commit 3ff70a3

Please sign in to comment.