public SoapEditorProxy(Connections.ConnectionData connData, ServiceDescription description, XmlSchemaSet schemas)
    {
      _connData = connData;
      _descrip = description;
      _schemas = schemas;
      _helper = new XmlCompletionDataProvider(schemas, "http://schemas.xmlsoap.org/soap/envelope/"
        , "soapenv", () => "xmlns:soap=\"" + description.TargetNamespace + "\""
        , e => (e.Name == "Envelope" && e.QualifiedName.Namespace == "http://schemas.xmlsoap.org/soap/envelope/")
          || TypeMatchesAction(e.QualifiedName, this.Action));

      _baseUrl = new Uri(_connData.Url).GetLeftPart(UriPartial.Path);
      switch (_connData.Authentication)
      {
        case Connections.Authentication.Windows:
          _cred = CredentialCache.DefaultNetworkCredentials;
          break;
        case Connections.Authentication.Explicit:
          _cred = new NetworkCredential(_connData.UserName, _connData.Password);
          break;
      }

      _actionUrls = _descrip.Services.OfType<Service>()
        .SelectMany(s => s.Ports.OfType<Port>().Where(SoapPort))
        .SelectMany(p => _descrip.Bindings[p.Binding.Name].Operations.OfType<OperationBinding>())
        .Select(o => new { Name = o.Name, Address = o.Extensions.OfType<SoapOperationBinding>().First().SoapAction })
        .Distinct()
        .ToDictionary(a => a.Name, a => a.Address);
    }
Example #2
0
        public SoapEditorProxy(Connections.ConnectionData connData, ServiceDescription description, XmlSchemaSet schemas)
        {
            _connData = connData;
            _descrip  = description;
            _schemas  = schemas;
            _helper   = new XmlCompletionDataProvider(schemas, "http://schemas.xmlsoap.org/soap/envelope/"
                                                      , "soapenv", () => "xmlns:soap=\"" + description.TargetNamespace + "\""
                                                      , e => (e.Name == "Envelope" && e.QualifiedName.Namespace == "http://schemas.xmlsoap.org/soap/envelope/") ||
                                                      TypeMatchesAction(e.QualifiedName, this.Action));

            _baseUrl = new Uri(_connData.Url).GetLeftPart(UriPartial.Path);
            switch (_connData.Authentication)
            {
            case Connections.Authentication.Windows:
                _cred = CredentialCache.DefaultNetworkCredentials;
                break;

            case Connections.Authentication.Explicit:
                _cred = new NetworkCredential(_connData.UserName, _connData.Password);
                break;
            }

            _actionUrls = _descrip.Services.OfType <Service>()
                          .SelectMany(s => s.Ports.OfType <Port>().Where(SoapPort))
                          .SelectMany(p => _descrip.Bindings[p.Binding.Name].Operations.OfType <OperationBinding>())
                          .Select(o => new { Name = o.Name, Address = o.Extensions.OfType <SoapOperationBinding>().First().SoapAction })
                          .Distinct()
                          .ToDictionary(a => a.Name, a => a.Address);
        }
Example #3
0
        public static SqlConnection GetConnection(Connections.ConnectionData data, string database = null)
        {
            string connString;

            switch (data.Authentication)
            {
            case Connections.Authentication.Anonymous:
                throw new NotSupportedException("Anonymous authentication is not supported.");

            case Connections.Authentication.Explicit:
                connString = string.Format("server={0};uid={1};pwd={2};database={3};MultipleActiveResultSets=True",
                                           data.Url, data.UserName, data.Password, database ?? data.Database);
                break;

            case Connections.Authentication.Windows:
                connString = string.Format("server={0};database={1};Trusted_Connection=Yes;MultipleActiveResultSets=True",
                                           data.Url, database ?? data.Database);
                break;

            default:
                throw new NotSupportedException();
            }

            return(new SqlConnection(connString));
        }
Example #4
0
 public SqlEditorProxy(Connections.ConnectionData connData)
 {
     _conn              = GetConnection(connData);
     this.ConnData      = connData;
     _helper            = new Editor.SqlEditorHelper(_conn);
     _outputHelper      = new Editor.PlainTextEditorHelper();
     _conn.InfoMessage += _conn_InfoMessage;
 }
    public SharepointEditorProxy(Connections.ConnectionData connData)
    {
      _connData = connData;

      switch (_connData.Authentication)
      {
        case Connections.Authentication.Windows:
          _cred = CredentialCache.DefaultNetworkCredentials;
          break;
        case Connections.Authentication.Explicit:
          _cred = new NetworkCredential(_connData.UserName, _connData.Password);
          break;
      }
    }
Example #6
0
        public SharepointEditorProxy(Connections.ConnectionData connData)
        {
            _connData = connData;

            switch (_connData.Authentication)
            {
            case Connections.Authentication.Windows:
                _cred = CredentialCache.DefaultNetworkCredentials;
                break;

            case Connections.Authentication.Explicit:
                _cred = new NetworkCredential(_connData.UserName, _connData.Password);
                break;
            }

            var handler = new HttpClientHandler();

            handler.Credentials     = _cred;
            handler.PreAuthenticate = true;
            _http = new HttpClient(handler);
        }