【问题标题】:WCAT returns 400 bad request for all requests?WCAT 为所有请求返回 400 错误请求?
【发布时间】:2010-10-06 22:18:39
【问题描述】:

我在 IIS 论坛上发布了此内容,但没有任何回复。所以我想我会在这里尝试。

我之前使用的是 WCAT 5.2,效果还不错。我正在尝试在我的本地计算机上同时运行客户端和服务器以及 IIS 7。由于某种原因,我请求的每个 url 的状态始终为 400(错误请求)当我查看 htterr 日志时,原因是主机名???

来自 httperr 日志:

#Fields: date time c-ip c-port s-ip s-port cs-version cs-method cs-uri sc-status s-siteid s-reason s-queuename 2010-10-06 04:02:15 127.0.0.1 43252 127.0.0.1 80 HTTP/1.1 GET /ds/test.html 400 - Hostname -

Exe 命令

wcat.wsf -terminate -run -t uad.ubr -f settings.ubr -singleip -x

Settings.ubr

settings
{

    clientfile     = "uad.ubr";
    server         = "localhost";
    clients        = 1;
    virtualclients = 10;

    counters
    {
        interval = 10;

        counter = "Processor(_Total)\\% Processor Time";
        counter = "Processor(_Total)\\% Privileged Time";
        counter = "Processor(_Total)\\% User Time";
        counter = "Processor(_Total)\\Interrupts/sec";

        counter = "Memory\\Available KBytes";

        counter = "Process(w3wp)\\Working Set";

        counter = "System\\Context Switches/sec";
        counter = "System\\System Calls/sec";

        counter = "Web Service(_Total)\\Bytes Received/sec" ; 
        counter = "Web Service(_Total)\\Bytes Sent/sec" ; 
        counter = "Web Service(_Total)\\Connection Attempts/sec" ; 
        counter = "Web Service(_Total)\\Get Requests/sec" ; 
    }

    registry
    {
        path = "System\\CurrentControlSet\\Control\\FileSystem";
        name = "NtfsDisableLastAccessUpdate";
        type = REG_DWORD;
    }

    registry
    {
        path = "System\\CurrentControlSet\\Services\\Tcpip\\Parameters";
        name = "SynAttackProtect";
        type = REG_DWORD;
    }
}

客户端文件 (uad.ubr)

scenario
{
    warmup      = 5;
    duration    = 10;
    cooldown    = 5;

    default
    {
        // HTTP1.1 request
        version = HTTP11;
    }

    transaction
    {
        id = "1";
        weight = 1;

        request
        {
            url = "/ds/test.html";
        }
    }
}

【问题讨论】:

    标签: iis-7 wcat


    【解决方案1】:

    服务器返回400 bad request,因为缺少一些header信息,需要在request元素中添加“Host”。

    request
    {         
            url = "/ds/test.html";
    
            setHeader
            {
                name = "Host";
                value = "127.0.0.1";
            }
    }
    

    【讨论】:

    • 非常感谢!我不知道为什么他们在文档中没有指出这一点。
    猜你喜欢
    • 1970-01-01
    • 2019-07-28
    • 2017-03-29
    • 1970-01-01
    • 2019-07-11
    • 2015-04-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多