I'm using SoapCore 1.1.0.8 with .NetCore 3.1
Does anyone know how to access the XML header from an envelope using SoapCore?
For example, an envelope like the following
<SOAP:Header xmlns='http://www.acompany.com/gsd'>
<ns0:AuthenticationInfo xmlns:ns0='http://customheader.com'>
<ns0:userName>Dummy_User</ns0:userName>
<ns0:password>Dummy_Pwd</ns0:password>
</ns0:AuthenticationInfo>
</SOAP:Header>
<SOAP:Body xmlns='http://www.acompany.com/gsd'>
<MsgReq xmlns='http://www.acompany.com/gsd' xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>
<MethodName>Identify</MethodName>
<MethodID>IS_001_01</MethodID>
.
.
</MsgReq>
</SOAP:Body>
</SOAP:Envelope>
How could you access the userName and password elements?
You can access to XML header by using IServiceOperationTuner.
After that register ServiceOperationTuner in Startup.cs.
In your service add
And after that you can get RAW Soap Header XML from HttpContext