Skip to content

Feature/273 retry on fault wcfsoapwithopenidconnect - #274

Open
ddemeyer wants to merge 2 commits into
masterfrom
feature/273-retry-on-fault-wcfsoapwithopenidconnect
Open

Feature/273 retry on fault wcfsoapwithopenidconnect#274
ddemeyer wants to merge 2 commits into
masterfrom
feature/273-retry-on-fault-wcfsoapwithopenidconnect

Conversation

@ddemeyer

@ddemeyer ddemeyer commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Closes #273

Added RetryOnFaultProxy<T>, a System.Reflection.DispatchProxy-based wrapper used by all Get*25Channel() accessors in InfoShareWcfSoapWithOpenIdConnectConnection. Catches CommunicationException/FaultException on the actual SOAP call, rebuilds the channel via the existing (unchanged) rebuild logic, and retries exactly once within the same cmdlet invocation - instead of requiring the caller to re-run the cmdlet for the existing #201/#219 rebuild-on-next-call mechanism to kick in. Reflection's TargetInvocationException is unwrapped via ExceptionDispatchInfo so callers keep seeing the original exception type and stack trace.

Only wraps the plain service-contract interface, not ICommunicationObject/IDisposable - channel state checks, Faulted event wiring and Dispose() bookkeeping keep operating on the raw private channel field unchanged.

Scoped to WcfSoapWithOpenIdConnect only; WcfSoapWithWsTrust (maintain-only, removed in product 16.0.0) is untouched, matching #201/#219 precedent. OpenApiWithOpenIdConnect (REST) re-reads its bearer token fresh per call and has no equivalent issue.

Added net48-only NuGet dependency System.Reflection.DispatchProxy (built into the BCL on net6.0+). Updated __ConnectionClassDiagram.cd and source-connection--csharp.instructions.md to document the new file per Connection layer conventions.

No automated test coverage added: Connection/ has no existing Pester tests and WCF channel-fault behavior is not reproducible without a live server and fault injection; validated by manual reproduction against a live server.
…lt. Fixed StackOverflow error by adding private Ensure methods.
@ddemeyer
ddemeyer requested a review from a team as a code owner September 2, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transparently retry once on 'unsecured or incorrectly secured fault' (WcfSoapWithOpenIdConnect only)

2 participants