Forum Discussion

dennenboom's avatar
dennenboom
Occasional Contributor
12 years ago

POST Parameters

Hi

I'm trying to test a REST service and am struggling with it.
SOAPUI Pro 4.6.1

I am POSTing to the service with parameters, however the parameters I list are not in the order that I setup.

I setup my parameters in this order
Ticket
Email
FileName
FileSize
File Content
ClientAppVer
ClientAppID
LanguageISOCode

When I go to form view it shows
ClientAppVer
FileSize
FileName
ClientAppID
LanguageISOCode
etc...

Then when I post it, I get
GatewayServlet?ClientAppVer=1&FileSize=1&FileName=1&ClientAppID=1&Languag.....

And I get a 400 error back saying syntactically incorrect.

5 Replies

  • Cizo89's avatar
    Cizo89
    Frequent Contributor
    Hi dennenboom,

    if it's possible, could you, please, show the raw request and raw response?
    It's hard to say what's wrong from those information above.

    Thanks in advance

    Regards,
    Marek
  • dennenboom's avatar
    dennenboom
    Occasional Contributor
    Hi Marek

    Here is the post

    POST https://***.webapps.**********.com/gateway-ws/GatewayServlet?ClientAppVer=1&FileSize=1&FileName=1&ClientAppID=1&LanguageISOCode=ar_ae&MessageTypeID=1&DeviceID=1&DevicePIN=1&Ticket=INC000026727837&FileContents=1&MessageTypeVer=1&TimeStamp=1&MessageID=1 HTTP/1.1
    Accept-Encoding: gzip,deflate
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 0
    Host: ****.webapps.************.com
    Connection: Keep-Alive
    User-Agent: Apache-HttpClient/4.1.1 (java 1.5)


    Response:

    HTTP/1.1 400 Bad Request
    Date: Thu, 21 Nov 2013 21:07:21 GMT
    Server: Apache/2.2.15 (Unix) mod_jk/1.2.15
    X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1
    TransactionID: 252-BDE
    GatewayErrorCode: 12
    Content-Length: 967
    X-Cnection: close
    Content-Type: text/html;charset=utf-8
    Set-Cookie: BIGipServerCUGQA001YYZA_80=2135553034.20480.0000; path=/
    Connection: close

    <html><head><title>JBoss Web/2.1.3.GA - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 400 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The request sent by the client was syntactically incorrect ().</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/2.1.3.GA</h3></body></html>


    One of the developers showed me this to test via curl:

    curl \-i \-X POST \-H Content-Type:application/x-www-form-urlencoded \-d 'Ticket=INC000026727837&Email=[blah@blah.com|mailto:blah@blah.com]&FileContents=0&FileName=blah&FileSize=0&TimeStamp=Wed May 20 03:40:13 1998&DeviceID=blah&DevicePIN=71009999&ClientAppID=blah&ClientAppVer=blah&MessageTypeID=blah&MessageTypeVer=blah&LanguageISOCode=en&MessageID={00000000-0000-0000-0000-000000000000}'
  • Cizo89's avatar
    Cizo89
    Frequent Contributor
    Hi,

    the problem, the HTTP 400 error is probably caused by values in your query params...following parameters and values caught my attention:
    - FileName=1
    - FileContents=1
    - TimeStamp=1

    Try to send correct values and check if it's working.
    In my opinion, this isn't a SoapUI problem/bug.

    The problem is probably in the TimeStamp parameter, because you're sending incorrect value (and format) and your code can't processed it correctly and therefore it's returning that error.

    Try to send values which are specified in the curl command.
    And btw, is that curl command working for you?

    Regards,
    Marek
  • dennenboom's avatar
    dennenboom
    Occasional Contributor
    Hi Marek

    I reset the REST project, and just used the parameterized url sent to me by the developer in the curl command.

    So I am getting a response of
    HTTP/1.1 202 Accepted
    Date: Fri, 22 Nov 2013 16:08:13 GMT
    Server: Apache/2.2.15 (Unix) mod_jk/1.2.15
    X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1
    TransactionID: C8D-5E7
    Content-Length: 0
    Content-Type: text/plain
    Set-Cookie: BIGipServerCUGQA001YYZA_80=2118775818.20480.0000; path=/
    Keep-Alive: timeout=15, max=100
    Connection: Keep-Alive

    So I am investigating on the app end why it's not processing now.