private static BridgeCredentialInfo ParseCredentials(XmlNode authNode)
        {
            BridgeCredentialInfo cred = null;
            XmlNode credNode          = authNode.SelectSingleNode("credentials");

            if (credNode != null)
            {
                cred          = new BridgeCredentialInfo();
                cred.User     = GetAttributeValue(credNode, "username", true);
                cred.Password = GetAttributeValue(credNode, "password", true);
                cred.Domain   = GetAttributeValue(credNode, "domain", true);
            }
            return(cred);
        }
Exemple #2
0
        public virtual void TransformRequest()
        {
            BridgeMethodInfo methodInfo = GetMethodInfoForCall(BridgeRequest.Method);

            // Set the server method name
            ServiceRequest.Method = methodInfo.ServerName;

            // Apply the parameter mapping/expressions
            ResolveParameters(methodInfo.Parameters, ServiceRequest.Args, Context);

            // Apply the credentials now only if the credentials aren't set already
            BridgeCredentialInfo credInfo = methodInfo.Credentials;

            if (ServiceRequest.Credentials == null && credInfo != null)
            {
                ServiceRequest.Credentials = new NetworkCredential((string)TryParseExpression(credInfo.User, Context), (string)TryParseExpression(credInfo.Password, Context), (string)TryParseExpression(credInfo.Domain, Context));
            }
        }
 private static BridgeCredentialInfo ParseCredentials(XmlNode authNode) {
     BridgeCredentialInfo cred = null;
     XmlNode credNode = authNode.SelectSingleNode("credentials");
     if (credNode != null) {
         cred = new BridgeCredentialInfo();
         cred.User = GetAttributeValue(credNode, "username", true);
         cred.Password = GetAttributeValue(credNode, "password", true);
         cred.Domain = GetAttributeValue(credNode, "domain", true);
     }
     return cred;
 }