I need to pass the following SOAP header into a WCF service call.
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsu:Timestamp wsu:Id="TS-3DCA13685AB558766615063665309446">
<wsu:Created>2017-09-25T19:08:50.943Z</wsu:Created>
<wsu:Expires>2017-09-25T20:48:50.943Z</wsu:Expires>
</wsu:Timestamp>
<wsse:UsernameToken wsu:Id="UsernameToken-3DCA13685AB558766615063665252595">
<wsse:Username>prdIDXXXX</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">XXXXXX</wsse:Password>
<wsu:Created>2017-09-25T19:08:45.259Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
The problem is, most of the solution in stackoverflow or other forums does this by creating a HttpWebRequest object.
example: calling WCF services using SOAP
However, in my case I already have a Service proxy class generated from WSDL. The proxy class has already created the service calling signature:
myResponseObject = ServiceProxy.MyServiceMethod(myRequestObject1, myRequestObject2);
How do I "inject" my soap header in the service call?