コード例 #1
0
        public override void ProcessInput(int inputID, PipelineBuffer inputBuffer)
        {
            while (inputBuffer.NextRow())
            {
                var parameters = GetWebServiceParameters(inputBuffer);

                var response = WebService.read(X3WebService.Context, PublicIdentifierValue, parameters);

                var xml = new XmlDocument();
                xml.LoadXml(response.resultXml);

                var responseXmlWrapper = new X3ObjectResponseWrapper(xml);

                outputBuffer.AddRow();
                foreach (var groupTag in responseXmlWrapper.ResultGroups)
                {
                    foreach (var fieldTag in groupTag.Fields)
                    {
                        var columnName = GenerateOutputColumnName(groupTag.Id, fieldTag.Name);
                        var outputCollumnIndex = GetOutputColumnIndex(columnName);
                        var outputColumn = GetOutputColumn(columnName);

                        SetColumnData(outputBuffer, outputCollumnIndex, fieldTag.Value, outputColumn.DataType);
                    }
                }
            }

            if (inputBuffer.EndOfRowset)
                outputBuffer.SetEndOfRowset();
        }
コード例 #2
0
        public override void ProcessInput(int inputID, PipelineBuffer inputBuffer)
        {
            while (inputBuffer.NextRow())
            {
                var inputCollection = ComponentMetaData.InputCollection[0];
                var inputColumns = inputCollection.InputColumnCollection.Cast<IDTSInputColumn100>().ToList();
                var parameters = new List<CAdxParamKeyValue>();
                for (int i = 0; i < inputColumns.Count; i++)
                {
                    var inputColumn = inputColumns[i];
                    var inputColumnIndex = GetInputCollumnIndex(inputColumn.Name);
                    var inputColumnValue = inputBuffer.GetString(inputColumnIndex);

                    parameters.Add(new CAdxParamKeyValue() { key = i.ToString(), value = inputColumnValue });
                }

                var binding = new BasicHttpBinding();
                binding.MaxReceivedMessageSize = WebServiceMaxResponse;

                var proxy = new CAdxWebServiceXmlCCClient(binding, new EndpointAddress("http://" + Ip + ":28880/adxwsvc/services/CAdxWebServiceXmlCC"));

                var response = proxy.read(CallContext, PublicIdentifier, parameters.ToArray());

                var xml = new XmlDocument();
                xml.LoadXml(response.resultXml);

                var responseXmlWrapper = new X3ObjectResponseWrapper(xml);

                outputBuffer.AddRow();
                foreach (var groupTag in responseXmlWrapper.ResultGroups)
                {
                    foreach (var field in groupTag.Fields)
                    {
                        var fieldName = groupTag.Id + "|" + field.Name;

                        try
                        {
                            var index = GetOutputCollumnIndex(fieldName);

                            outputBuffer.SetString(index, field.Value);
                        }
                        catch(Exception e) {}
                    }
                }
            }

            if (inputBuffer.EndOfRowset)
                outputBuffer.SetEndOfRowset();
        }