小编Jas*_* La的帖子

C#:为特定的代码块使用命名空间?

我只是有好奇心.我正在使用SSRS并调用其SOAP方法.我已经生成了存根/创建了Web引用,并且一切正常,我可以使Web服务调用正常.

问题:从WSDL,ReportService2005和ReportExecution生成的两个类有一些重叠的类定义,例如ParameterValue,DataSourceCredentials,ReportParameter.

在C#中,有没有办法说,"对于方法中的这个代码块,使用这个命名空间?"

伪/主要是构建错误代码:

use-this-namespace (ReportService2005)
{
    ParameterValue[] values = null;
    DataSourceCredentials[] credentials = null;
    ReportParameter[] parameters;
}
Run Code Online (Sandbox Code Playgroud)

我知道我可以写出全名,ReportService2005.ParameterValue [] values = null.或者我可以在我的类/控制器声明之前在顶部对两个类进行别名.这只是我很好奇的事情.

c# namespaces

11
推荐指数
2
解决办法
1万
查看次数

SSRS:获取单个Web服务调用中的所有报告和参数的列表?

简短版本:是否有一种Web服务方法可以返回所有可用报告的名称以及每个报告的参数?

我将我的Web代码(C#/ MVC)连接到SSRS Web服务,并且我能够通过这些服务检索报告.

我知道我可以获得这样的可用报告列表:

var rService = new ReportingService2005
{
 Url = @"http://domain.com/ReportServer/ReportService2005.asmx?wsdl",
 Credentials = System.Net.CredentialCache.DefaultCredentials
};

var reportList = rService.ListChildren(@"/Blah", true);
Run Code Online (Sandbox Code Playgroud)

ListChildren()的结果提供了大量信息,但没有列出每个报告的参数.为了获取报告的参数,我需要单独调用:

string historyId = null;
ReportService.ParameterValue[] values = null;
ReportService.DataSourceCredentials[] credentials = null;

var parameters = rService.GetReportParameters(@"/Blah/" + reportName, historyId, true, values, credentials);
Run Code Online (Sandbox Code Playgroud)

因此,如果我想获取所有可用的报告及其参数,我需要遍历ListChildren的结果,这意味着我将为每个报告进行Web服务调用.

有没有更好的方法呢?

c# web-services reporting-services

11
推荐指数
1
解决办法
1万
查看次数

在nginx后面运行一个Spring Boot应用程序

我有一个Spring Boot + MVC应用程序在我的服务器上运行并且它必然会被绑定http://localhost:8000.

有一个nginx代理(或者它是一个反向代理,不确定名称)在端口80和443上侦听外部世界.根(/)将正确解析,但其下的任何内容都无法解析并导致404错误(/ someControllerName/action,/ images/,/ css /).

我有这个作为我的配置:

upstream jetty {
        server localhost:8000;
}

server {
        listen       80;
        server_name  domain.com;
        return       301 http://www.domain.com$request_uri;
}

server {
        listen       443;
        server_name  domain.com;
        ssl_certificate /etc/nginx/ssl/ssl.crt;
        ssl_certificate_key     /etc/nginx/ssl/ssl.key;
        return       301 https://www.domain.com$request_uri;
}

server {
        listen 80 default_server;
        listen 443 ssl;

        root /usr/share/nginx/html;
        index index.html index.htm;

        server_name www.domain.com localhost;

        #ssl    on;
        ssl_certificate /etc/nginx/ssl/ssl-unified.crt;
        ssl_certificate_key     /etc/nginx/ssl/ssl.key;

        location / {
                # First attempt to serve request as file, then
                # as …
Run Code Online (Sandbox Code Playgroud)

nginx spring-boot

11
推荐指数
1
解决办法
1万
查看次数

301在代理后面运行非标准端口的nginx机器上重定向

我有一个处理PHP请求的nginx服务器,但它被配置为侦听非标准端口(端口12345或其他东西).我无法改变监听端口,因为企业IT部门说"不"

数据中心有一个代理服务器将来自www.domain.com:80的请求转发到端口12345上的nginx框.

我有一些静态的301重定向,我需要将其放置到位,但我会遇到意想不到的行为.

示例重定向在site.conf"server {}"块中:

rewrite ^/foo$ /bar/foo/ permanent;
Run Code Online (Sandbox Code Playgroud)

当我尝试访问www.domain.com/foo时,会发生重定向,但它会尝试将浏览器转发到www.domain.com:12345/bar/foo/

我的问题是,如何让nginx将用户重定向到正确的端口(www.domain.com/bar/foo/)?

也许更好的问题是,做我要问的正确方法是什么?有50多个重定向需要进入,我宁愿不为每个重定向创建一个"位置"部分.

redirect reverse-proxy nginx

6
推荐指数
1
解决办法
1692
查看次数

Jersey客户端是否在异常时关闭连接?

我已经阅读了Jersey文档,它说Jersey在读取实体后会自动关闭连接(例如response.readEntity(SomeObject.class))

但是当抛出异常时,无论是错误的请求还是套接字超时,Jersey都会自动关闭连接,还是应该有一个调用client.close()的finally子句?

jax-rs jersey

5
推荐指数
1
解决办法
5406
查看次数

nginx:将单个静态URL映射到PHP文件

我有一个WordPress安装启动并运行没有问题.页面上有一个元素不是WP的一部分,而是我们自己的自定义PHP脚本.只是在那里处理表单POST请求并在某种程度上处理它.

要求我们没有以.php结尾的扩展名.我的表单提交的内容如下:

/places/signup.html
Run Code Online (Sandbox Code Playgroud)

在我的nginx配置中,我有这个:

server {
    listen       87948; # It's behind a reverse proxy
    server_name domain.com www.domain.com;

    include /etc/nginx/proxy_params;

    index index.php;
    root /opt/www/public_html;

    location /favicon.ico {
        return 404;
    }

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
        expires max;
        log_not_found off;
    }

    location ~ \.php$ {
        add_header Access-Control-Allow-Origin "*";
        client_body_buffer_size 4096k;
        fastcgi_pass unix:/tmp/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /opt/www/public_html/$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_script_name;
        include /etc/nginx/fastcgi_params;
    }

    # LOOK HERE
    location ~ /places/signup.html {
        root                             /opt/www/custom_scripts/;
        fastcgi_pass    unix:/tmp/php5-fpm.sock;
        fastcgi_param …
Run Code Online (Sandbox Code Playgroud)

fastcgi nginx

4
推荐指数
1
解决办法
8354
查看次数

为什么 Mac 上的 dotnet new 不创建 .csproj 文件?

在 OSX 中安装 .NET Core SDK 1.1 后,该dotnet new命令会创建两个文件:

Program.cs
project.json
Run Code Online (Sandbox Code Playgroud)

我以为MS正在走向csproj?非Windows环境不也是这样吗?有没有我错过的地方的公告?

.net macos .net-core asp.net-core

3
推荐指数
1
解决办法
1332
查看次数