We are using SDL Web 8.5. Trying to create a custom application which will get all PDF component and download them inside a specific location while trying to download pdf file from corresponding multimedia component I'm getting this error:
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.
I am using below code to initialize StreamDownloadClient
BasicHttpBinding basicHttpBinding = new BasicHttpBinding
{
MaxReceivedMessageSize = 10485760,
ReaderQuotas = new XmlDictionaryReaderQuotas
{
MaxStringContentLength = 10485760,
MaxArrayLength = 10485760
},
MessageEncoding = WSMessageEncoding.Mtom,
Security = new BasicHttpSecurity
{
Mode = BasicHttpSecurityMode.None,
}
};
var remoteAddress = new EndpointAddress("http://xxx.xxx.xxx.xxx/webservices/CoreService2013.svc/streamDownload_basicHttp");
StreamDownloadClient streamDownloadClient = new StreamDownloadClient(basicHttpBinding, remoteAddress);
return streamDownloadClient;