Hi
Has anyone managed to send XML files to TN using a .NET Client? I have tried various ways to do this but always end up with a 401 Access Denied Exception. Posting the file in a browser with the same credentials works fine.
c# code below
WebClient client = new WebClientSIZE=2;
[/size]CredentialCache myCreds = new CredentialCacheSIZE=2;
[/size]NetworkCredential myCred = new NetworkCredential(“user”, “password”, “”);
myCreds.Add(“https://tnurl/receive”, 443, “Basic”, myCred);
client.Credentials = myCreds;
client.Headers.Add(“Content-Type”, "text/xml ");
client.UploadFile(url, “POST”, “c:\test.xml”);
have also tried adding the username and password in the header with
[SIZE=2]
client.Headers.Add(“Authorization”, "Basic " +
Convert.ToBase64String(Encoding.ASCII.GetBytes(“ATUKPLC:ATUKPLC”[SIZE=2])));
but still doesn’t work. Also tried directly with the HttpWebRequest object but same result.
I have managed this with a Java client using the Apache HTTPClient API (which was also a struggle) but can’t get it with .NET.
Any suggestions welcome.
Thanks
[/size]
[/SIZE]
#Integration-Server-and-ESB#B2B-Integration#webMethods