Problem Description
==================
Some RosettaNet user’s trading partner’sweb site requires HTTPS + Basic Authentication. In this case, they have tocustomize the default RNIFSend web page to support Basic Authentication.
Problem Resolution
1.Add thefollowing code to CreateOuterHttpRequest method of RNIFSend.aspx.cs inRosettaNet SDK.
request.PreAuthenticate= true;
string username= System.Configuration.ConfigurationManager.AppSettings["BasicAuthUsername"];
string password= System.Configuration.ConfigurationManager.AppSettings["BasicAuthPassword"];
NetworkCredentialcredential = new NetworkCredential(username,password);
CredentialCachecredentialCache = new CredentialCache();
credentialCache.Add(url,"Basic", credential);
request.Credentials= credentialCache;
2.Modify thefirst line of RNIFSend.aspx as:
<%@ Pagelanguage="c#" CodeFile="RNIFSend.aspx.cs"AutoEventWireup="false"Inherits="Microsoft.Solutions.BTARN.RNIFSend.RNIFSend" %>
3.Add the following section to web.config.
<appSettings>
<add key="BasicAuthUsername" value="Administrator"/>
<add key="BasicAuthPassword" value="Password01!"/>
</appSettings>
4. Compile the web page and use thefollowing steps to deploy:
Thanks,
WenJun Zhang