dotnet / dotnet/wcf

Introduce HeaderException

Open
#5,204 4 comments 0 reactions 1 assignee Claimed by @mconnew View on GitHub
triaged
Dominant language
C#
Stars
1.8k
Forks
576
Avg merge
6d 9h
Merged PRs (30d)
2

Description

I use WCF client to work with EWS SOAP client. There are cases when a service returns answer like below:
![image](https://github.com/dotnet/wcf/assets/12067139/8f02dbf8-e38e-4f94-afae-4bd890bd15a8)

Usually, it is handled properly and I get a FaultException. But in my case I set MessageVersion as Soap11 without adressing.
![image](https://github.com/dotnet/wcf/assets/12067139/24ff5c65-5509-4a48-8e3e-a1e0a9cdf661)

And due to that, WCF throw an InvalidOperationException with message
`Addressing Version 'AddressingNone (http://schemas.microsoft.com/ws/2005/05/addressing/none)' does not support adding WS-Addressing headers`

I am OK with that behavior but I would like to ask to make the exception more unique. Because I want to handle that case properly but there is only one way to recognize my cause is checking an error message in the exception.
It would be nice to have something like special exception like HeaderException or have uniq error code in Data field in InvalidOperationException.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.