在jmeter中无法上传使用“Multipart Streamprovider”和kerberos身份验证的Web应用程序中的配置文件图片

时间:2016-08-28 11:12:29

标签: html asp.net json forms jmeter

我正在尝试使用JMeter工具在我的Web应用程序中上传图片。但是我收到了501 : not Implemented错误。

完成一些冲浪后,我发现它正在使用 Kerberos身份验证,因此在JMeter的System.properties文件中也进行了配置。但是,我仍然得到同样的e rror : 501。请任何人帮我解决这个问题。

示例结果:

Thread Name: Thread Group_Tester Profile_updated 1-1
Sample Start: 2016-08-28 14:51:26 IST
Load time: 48503
Connect Time: 570
Latency: 48503
Size in bytes: 362
Headers size in bytes: 303
Body size in bytes: 59
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: 501
Response message: Not Implemented

Response headers:
HTTP/1.1 501 Not Implemented
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 59
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Access-Control-Allow-Origin: *
Date: Sun, 28 Aug 2016 09:22:10 GMT


HTTPSampleResult fields:
ContentType: application/json; charset=utf-8
DataEncoding: utf-8

请求

    POST        http://revflexgatewaysit.azurewebsites.net/api/TesterProfile/UploadTesterProfile?Id=69437&UpdateAdminId=0

    POST data:
    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="hprofileUploadPhoto"

    TestPhoto.jpg
    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="firstName"

    hammee ham 
    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="lastName"

    hamm1
    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="emailId"

    hammee@yopmail.com
    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="phoneNumber"

    98789990 
    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="gender"

    Male
    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="occupationStatusName"

    string:2
    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="workHoursName"

    string:3
    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="city"

    Cheannai
    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="state"

    Tamilnadu
    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="countryName"

    76
    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="postalCodeName"

    600005
    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="skypeId"


    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="aboutMe"

    hiiiii
    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="facebookId"

    https://abc@facebook.com
    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="twitterId"

    https://abcd@twitter.com
    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="linkedinId"

    https://kfljlj@linkedin.com
    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="googlePlusId"

    https://flk@plus.google.com
    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="accessToken"

            WooZaoSuVwF5xaNisPbw0xYoofkpTRMRXcc0AYYumP8xi-]a6LPuRpPuDU4sbGibcMRF1dcNREKQqCp    u9a9XllrYntgXOqQFLAvl8w8d85T_2j6jIjp5eZh4XCNxrSOIRs--ttNsqLYuBdGLKIquK8oCy0iyjEPhaUvl79mtLd8Fz91lPnT m8-PIU3E7_00hRpYDN1rx1X8SvlghdA5ZAAiSWZX-YS9iHZ6LYgb09QKPNhaU0gxSYK9L8lH7ksMJOEfNmlPp5kFkj_fQ-EDxyKI NeTRTfjKwCkmcNdfY6mnF36itrD_pxL65y-e5_8sAUlFQ_3UgzfWE9ytibxyvnfMvydZ3aQm4xvUcnhCb_QLgwnW0UYpq8aZw89I JScGZySEd3bT38V5p1ktNoqud9CoTOAfDUlFXxJcFTfipX9_LJelO1masOp4gJcdfcY3N_mcAmR4ixwswCNXRcgTLSZDHBSSTYSF1XMgIGEVpehDSBdDY
--np-Zxf5w6hXofm0a8SNXC5632tmk_IV45
    Content-Disposition: form-data; name="profileUploadPhoto"filename="Jellyfish.jpg"
    Content-Type: image/jpeg

    <actual file content, not shown here>
    --np-Zxf5w6hXofm0a8SNXC5632tmk_IV45--


    Cookie Data:
    ARRAffinity=dab3b2a48d5eeba2e398c4272dad09fe1b0f7e17abfbf187e75f241b8f6737e4

    Request Headers:
    Connection: keep-alive
    Referer: http://revflexsit.azurewebsites.net/
    Accept-Language: en-US,en;q=0.5
    Origin: http://revflexsit.azurewebsites.net
    Organziation: 1
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:48.0) Gecko/20100101       Firefox/48.0
    Accept: application/json, text/plain, */*
    Authorization: Bearer    x_7zFLPhUrHQwIssBFVvFOlIMlNDpDNBCjohwJG5qjJWQ3zWIAC7cPpnv5f1vH6ZEfIxRS28ui2cD6u5aW8CMZCm1BhhbcaRGxXwmZEBtGIwIANWu7r6RdaIIeIrq6AYNixDo6L4O7tfALHcTLpbiElgbHrKJ3YKbWqNdEXC7fNmI74Aq-  _0D2y1id5plxoTJclOQ5UKFHssMUCh0MWpcRE_lKFM1JqNzlp37wVQUoQjCzXo-  HW_MxNUqF9zgbnf_XPXRKEB1wZpYwbK30hno-  GWD85P3NPknhzCGgkW3rTPsBalULHeSbrGGYIKACNhi8CKtC_8YbwM8RL1UC-fW_tm- e_jqICocs6zwySNzcg7X9BsFe2RrDFielbs41iDSNanAxfFlqdgVhZLOiyR8NxvCLZxrwq2WEvEtdk83scF8LnOTKiCXUFpmkGjGcMOfvOw_s8DtXLugfJBLEyh7Dvc6gyGjGHBmp6eWThs_bb20bmU
    Content-Length: 778351
    Content-Type: multipart/form-data; boundary=np-  Zxf5w6hXofm0a8SNXC5632tmk_IV45; charset=US-ASCII
    Host: revflexgatewaysit.azurewebsites.net

回复数据:

"Error in application. Please contact Revolution IT admin."

但手动上传图片上传工作正常。

1 个答案:

答案 0 :(得分:0)

根据HTTP response status codes表格

  

501未实施

     

服务器不支持请求方法,无法处理。服务器需要支持的唯一方法(因此必须不返回此代码)是GET和HEAD。

因此,您的服务器可能需要HTTP PUT方法。

所以我建议使用以下方法之一:

  1. 使用HTTP(S) Test Script Recorder记录您的请求,可以构建请求&#34;骨架&#34;,您可以稍后应用参数化和关联
  2. 使用嗅探器工具比较使用浏览器和JMeter发送的请求。最好的是Wireshark。修改JMeter配置,使其完全匹配(除了动态参数,如果有的话)
  3. 如果您仍需要手动构建请求,请查看Testing REST API File Uploads in JMeter指南,了解分步说明和示例
  4. P.S。查看def ask_name(): while True: name = raw_input("What is your name?") if name.isalpha(): return name else: print("Please use only letters, try again") 标题,您的服务器似乎使用OAuth,而不是Kerberos