Setting mustunderstand to false in wcf client created with dotnet-svcutil
I have generated a client with the dotnet-svcutil to be able to use an external WSDL service, the client uses WSHttpBinding. The connection works, but I get the response "One or more mandatory SOAP header blocks not understood". I checked the request in Soap Ui, same result as long as MustUnderstand is true. I have already built several PHP clients for this web service and never had this problem there.
Here it is suggested to set the MessageHeader.MustUnderstand to false. https://github.com/dotnet/wcf/issues/3304 But how and where to do that?
My dotnet-svcutil.params.json:
"providerId": "Microsoft.Tools.ServiceModel.Svcutil",
"version": "2.0.2",
"options": {
"inputs": [
"https://webservice1.foobar.example/foobarWSCore/jaxws/UnternehmensInfoService20x0?wsdl"
],
"enableDataBinding": true,
"messageContract": true,
"namespaceMappings": [
"*, MyNamespace.ServiceReference"
],
"outputFile": "Reference.cs",
"targetFramework": "netcoreapp3.1",
"typeReuseMode": "All"
}
}```
Hi there,
I'm also interested in answer. We're integrating with external SOAP API and adding following header
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none"></Action>
results into error returned from API :
Must Understand check failed for header http://schemas.microsoft.com/ws/2005/05/addressing/none : Action
@rebrovoleksii Here is a Workaround: https://stackoverflow.com/questions/53321927/wshttpbinding-in-netstandard-or-net-core
@imcarolwang can you please take a look?
Hi @jangaehler sorry for the late response, to add a message header in a client request, you can refer to answer of this stackoverflow question link: https://stackoverflow.com/questions/56768566/adding-message-header-to-request. Hope this helps.