Optimizing the SvcUtil generated proxies for single use scenarios
- Dominant language
- C#
- Stars
- 1.8k
- Forks
- 576
- Avg merge
- 6d 9h
- Merged PRs (30d)
- 2
Description
We use SvcUtil generated proxy to talk to a SOAP Web Service, which has tenant specific URLs. E.g. we might need the proxy to call https://tenantA.api.service.com, https://tenantB.api.service.com, etc.
On top of that, we use the proxy in an AWS Lambda function.
In general, the proxy (ClientBase derived client) can take around 10-15s on the first time we call the API on a specific tenant. The subsequent call would take 1-2s. We are already using the XmlSerizliation library (without it, we've seen the first call take up to 30s).
In the Lambda function, when we create and execute a WS call, we are always paying the above overhead cost of initializing and not get the benefit for subsequent calls except for 1-2 more calls that the function may do.
We could be working with 1000s of tenants so, pre-initializing and holding on to those clients is not an option (more so, in a Lambda function).
How do we optimize for this scenario?
If we craft a SOAP envelope and call the API using a HttpClient, the op takes about 2-5s. However, serializing the proxy classes to SOAP hasn't worked out for us (raised a different question here, regarding that). Removing the first call overhead from the ClientBase derived client would be the best option, if that is possible.
Contributor guide
Assessment
This issue has not been assessed yet.