コード例 #1
0
        public IActionResult Test(ReportRequest request)
        {
            var client = new SAWSessionServiceSoapClient(SAWSessionServiceSoapClient.EndpointConfiguration.SAWSessionServiceSoap, _config.GetValue <string>("SessionServiceUrl"));
            //var session = client.logonAsync("oracle.admin", "Burger01!").Result;
            var session = client.logonAsync("tperluss", "7Xo34%GN1XTZ94TI4cMT").Result;

            var svc = new XmlViewServiceSoapClient(XmlViewServiceSoapClient.EndpointConfiguration.XmlViewServiceSoap, _config.GetValue <string>("XmlServiceUrl"));

            var report = new ReportRef {
                reportPath = request.ReportPath
            };

            var output = svc.executeXMLQueryAsync(report, XMLQueryOutputFormat.SAWRowsetSchemaAndData, new XMLQueryExecutionOptions(), new ReportParams(), session.sessionID).Result;
            var resp   = _translationService.Translate([email protected]).Result;

            return(Ok(resp));
        }
コード例 #2
0
        public IActionResult GetSchema(ReportRequest request)
        {
            var client = new SAWSessionServiceSoapClient(SAWSessionServiceSoapClient.EndpointConfiguration.SAWSessionServiceSoap, _config.GetValue <string>("SessionServiceUrl"));
            //var session = client.logonAsync("oracle.admin", "Burger01!").Result;
            var session = client.logonAsync("tperluss", "7Xo34%GN1XTZ94TI4cMT").Result;

            var svc = new XmlViewServiceSoapClient(XmlViewServiceSoapClient.EndpointConfiguration.XmlViewServiceSoap, _config.GetValue <string>("XmlServiceUrl"));

            request.ReportPath = HttpUtility.UrlDecode(request.ReportPath);

            var report = new ReportRef
            {
                reportPath = request.ReportPath
            };

            var output = svc.executeXMLQueryAsync(report, XMLQueryOutputFormat.SAWRowsetSchema, new XMLQueryExecutionOptions(), new ReportParams(), session.sessionID).Result;

            var schema = Deserialize <rowsetschema>([email protected]("http://www.w3.org/2001/XMLSchema", "http://www.w3.org/2001/WB"));

            var resp = new ReportSchema {
                Columns = new List <ColumnSchema>(), ReportPath = request.ReportPath
            };

            schema.schema.complexType.sequence.ToList().ForEach(a => {
                resp.Columns.Add(new ColumnSchema {
                    ColumnId       = a.columnID,
                    IsDoubleColumn = a.isDoubleColumn,
                    MaxOccurs      = a.maxOccurs,
                    MinOccurs      = a.minOccurs,
                    Name           = a.name,
                    TableHeading   = a.tableHeading,
                    ColumnHeading  = a.columnHeading,
                    Type           = a.type.Replace("xsd:", ""),
                    SqlType        = a.type1
                });
            });

            return(Ok(resp));
        }