I am trying to get data from SOAP service but cant get it work. The problem is, I think .net core has not been implemented all of the binding methods. I also have working example but it is written with .net Framework.
So question is, Here is the working configuration "Web.config"
</customBinding>
<binding name="example">
<security authenticationMode="UserNameOverTransport" enableUnsecuredResponse="true" includeTimestamp="false" />
<textMessageEncoding messageVersion="Soap12" />
<httpsTransport maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" />
</binding>
I attempted to do that configuration in .net core, but no way. Always get some platform error and even If I get it work, service needs basic authentication and it fail etc etc. So here is my latest attempt which give me "TransportSecurityBindingElement.BuildChannelFactoryCore is not supported." error:
CustomBinding binding = new CustomBinding()
{
Name = "example",
ReceiveTimeout = new TimeSpan(0, 0, 100, 0, 0),
SendTimeout = new TimeSpan(0, 0, 100, 0, 0),
};
var element1 = SecurityBindingElement.CreateUserNameOverTransportBindingElement();
var element2 = new HttpsTransportBindingElement()
{
ManualAddressing = false,
MaxReceivedMessageSize = 2147483647,
AllowCookies = false,
AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous,
BypassProxyOnLocal = false,
MaxBufferSize = 2147483647,
ProxyAuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous,
TransferMode = TransferMode.Buffered,
UseDefaultWebProxy = true
};
var element3 = new TextMessageEncodingBindingElement(MessageVersion.Soap11, System.Text.Encoding.UTF8);
binding.Elements.Add(element1);
binding.Elements.Add(element3);
binding.Elements.Add(element2);
And also, As you can see, I need a security binding which needs
<security authenticationMode="UserNameOverTransport" enableUnsecuredResponse="true" includeTimestamp="false" />
But even in code, I cannot create that binding on my own. Even If I did, code will not work because of the problem as I mentioned above. Thank you for your time