I'm trying to create a WsHttpBinding entirely in code, within an SSIS Script Task.
The script task will not have access to an app.config file at run time so I need to create the binding manually and set the parameters in code:
WSHttpBinding binding =
new WSHttpBinding{
Security = new WSHttpSecurity{
Mode= SecurityMode.TransportWithMessageCredential,
Message = new NonDualMessageSecurityOverHttp{
ClientCredentialType = MessageCredentialType.UserName,
}
}
};
This compiles fine and is usable under .Net 4, however SSIS Script Task can only use Net 3.5 as its target runtime.
When trying to compile this code, I get several compiler errors stating that some of the properties above are in accessible due to their protection level.
There is obviously a fundamental change between 3.5 and 4 that allows this under 4 but not 3.5.
Can anyone offer a workaround to achieve the above in 3.5?