Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..
5479 views

LoadRunner 12 - HTTP Status-Code=400 (Bad Request) for Web Services

Jump to solution

Hi, 

I've a problem when executing a web service call registered with HTTP/HTML Protocol, using a "web_custom_request" function: the server response is 

                     Error -26631: HTTP Status-Code=400 (Bad Request) for...

but if I test the URL and the request message with SoapUI or via browser I get a positive response message. 

I've read many suggestions to resolve the problem: add necessary headers with "web_add_auto_header" function, using the Web Service Protocol and import the XML request directly, ecc. but no one of these operations can resolve the dilemma. 

That's my "web_custom_request" function: 

Action()
{
    web_add_auto_header("Accept-Encoding","gzip,deflate");
    web_add_auto_header("User-Agent","Apache-HttpClient/4.1.1 (java 1.5)");    
    
    web_custom_request("nobsm",
    "URL=http://agnbmocclu.syssede.systest.sanpaoloimi.com:80/nobsm?wsdl",
    "Method=POST",
    "RecContentType=text/xml",
        "EncType=text/xml; charset=utf-8",
    "Snapshot=t1.inf",
    "Body="     ...

Attached to the post, an image of the SoapUI proof: the response is HTTP 200 OK when I execute the same request with SoapUI software, but with LoadRunner I receive an HTTP 400 Bad Request response. 

Can anyone help me? Thanks a lot, 

Lorenzo 

0 Likes
1 Solution

Accepted Solutions
Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

Re: LoadRunner 12 - HTTP Status-Code=400 (Bad Request) for Web Services

Jump to solution

I've resolved the problem: in the request there's a special character (in particular, " à ") which can't be interpretated by the C compilator. So I've used a "web_custom_request" function with a "BodyBinary" instead of a  standard "Body" definition and I've replaced the special character with its ASCII code. Here a frame of the function: 

web_custom_request("withbsm",
                               "URL=http://…",
                               "Method=POST",
                               "RecContentType=text/xml",
                               "EncType=text/xml;charset=UTF-8",
                               "BodyBinary="     
                                               "<soapenv:Envelope xmlns:soapenv=\"http:…

                               …

                               "<Param Name=\"Cod....\xc3\xa0\" Value=\"\"/>"

                               …

 

Thanks for the collaboration, 

Lorenzo

View solution in original post

0 Likes
1 Reply
Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

Re: LoadRunner 12 - HTTP Status-Code=400 (Bad Request) for Web Services

Jump to solution

I've resolved the problem: in the request there's a special character (in particular, " à ") which can't be interpretated by the C compilator. So I've used a "web_custom_request" function with a "BodyBinary" instead of a  standard "Body" definition and I've replaced the special character with its ASCII code. Here a frame of the function: 

web_custom_request("withbsm",
                               "URL=http://…",
                               "Method=POST",
                               "RecContentType=text/xml",
                               "EncType=text/xml;charset=UTF-8",
                               "BodyBinary="     
                                               "<soapenv:Envelope xmlns:soapenv=\"http:…

                               …

                               "<Param Name=\"Cod....\xc3\xa0\" Value=\"\"/>"

                               …

 

Thanks for the collaboration, 

Lorenzo

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.