Skip to main content
Notice removed Authoritative reference needed by CommunityBot
Bounty Ended with no winning answer by CommunityBot
Notice added Authoritative reference needed by chuckd
Bounty Started worth 100 reputation by chuckd
added 517 characters in body
Source Link
chuckd
  • 14.8k
  • 34
  • 182
  • 407

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.

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 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(); 

so I want to replace it with the lib 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?

I want to use this WcfCoreMtomEncoder lib here in my .Net Core project but I'm not sure how to use it syntactically.

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(); 

From what I read I can replace it with this 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.

Source Link
chuckd
  • 14.8k
  • 34
  • 182
  • 407

How do I use WcfCoreMtomEncoder in a .Net Core project?

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 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(); 

so I want to replace it with the lib 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?