I want to use this WcfCoreMtomEncoder lib here in my .Net Core project but I'm not sure how to use it syntactically.
Currently I have this code below but can't use MessageEncoding because I'm in a .Net Core project (no mtom support):
var binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport) { // MessageEncoding = WSMessageEncoding.Mtom, not supported in .Net Core TransferMode = TransferMode.Streamed }; EndpointAddress endpoint = new EndpointAddress(url); var channelFactory = new ChannelFactory<T>(binding, endpoint); var webService = channelFactory.CreateChannel(); user.UserName = await webService.EncryptValueAsync(userName); user.Password = await webService.EncryptValueAsync(password); var documentAddResult = webService.DocumentAdd(document); channelFactory.Close(); soFrom what I want toread I can replace it with the libthis library code below and I see from the documentation for the encoder lib that the usage looks like this:
var encoding = new MtomMessageEncoderBindingElement(new TextMessageEncodingBindingElement()); var transport = new HttpTransportBindingElement(); var customBinding = new CustomBinding(encoding, transport); var client = new MtomEnabledServiceClient(customBinding); but I'm not sure what's what here? How would it be used to perform the document upload I'm trying to achieve? And is the library doing this or am I misunderstanding what it does?
If anyone can provide me an example of how to use this library to perform the document upload it would be appreciated.