Wikis - Page

LoadRunner 21 - Webservice Soap request returning error code 400

0 Likes

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("Content–Type","text/xml;charset=UTF-8");
web_add_auto_header("SOAPAction","http://tempuri.org/uploadDocumentWithOperation");
//web_add_header("Content-Length", "3773");
web_add_auto_header("Accept-Encoding","gzip,deflate,br");
//web_add_header("Host","dms-dev2.dev.sc.egov.usda.gov");
web_add_auto_header("Connection","Keep-Alive");
web_add_auto_header("User-Agent","Apache-HttpClient/4.5.14 (Java/17.0.10)");


web_custom_request("StepName=SOAPRequest",
"URL=https://dms-dev2.dev.sc.egov.usda.gov/DMS/Services/DocumentInterface.asmx",
"Method=POST",
"Resource=0",
"RecContentType=text/xml",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
"BodyBinary="
"<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:tem=\"http://tempuri.org/\">"
"<soap:Header>"
"<tem:AuthHeader>"
"<tem:applicationId>130</tem:applicationId>"
"<tem:wsSecuredToken>002C2C22-2E34-4A72-ABF7-29618E4A8BFE</tem:wsSecuredToken>"
"</tem:AuthHeader>"
"</soap:Header>"
"<soap:Body>"
"<tem:uploadDocumentWithOperation>"
"<tem:uploadDocument>"
"<tem:DocumentTypeId>EnvironmentalEvaluation:v1</tem:DocumentTypeId>"
"<tem:UploadedByUsdaeauthID>99999999900000000000302</tem:UploadedByUsdaeauthID>"
"<tem:UploadedByDisplayName>JACK SPARROWK</tem:UploadedByDisplayName>"
"<tem:Title>TEST Upload for Env Eval Doc Type</tem:Title>"
"<tem:StateNameDisplay>Arizona</tem:StateNameDisplay>"
"<tem:CountyDisplay>Coconino</tem:CountyDisplay>"
"<tem:StateCode>04</tem:StateCode>"
"<tem:StateCountyCode>005</tem:StateCountyCode>"
"<tem:FileName>TEST_Env_Upload_JMcG.txt</tem:FileName>"
"<tem:HumanReadableFileName>TEST_Env_Upload_JMcG.txt</tem:HumanReadableFileName>"
"<tem:ObjectTypeID>nrcs:form</tem:ObjectTypeID>"
"<tem:MimeType>text/plain</tem:MimeType>"
"<tem:ModifiedByHistory>"
"<tem:string>99999999900000000000302</tem:string>"
"</tem:ModifiedByHistory>"
"<tem:FarmNumbers></tem:FarmNumbers>"
"<tem:DocumentVersions>"
"<tem:CMISDocument>"
"<tem:DocumentVersions>"
"<tem:CMISDocument xsi:nil=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"></tem:CMISDocument>"
"</tem:DocumentVersions>"
"<tem:CallingApplicationId>130</tem:CallingApplicationId>"
"<tem:AdministrativeAreaID>0</tem:AdministrativeAreaID>"
"<tem:AgreementMajorModNumber>0</tem:AgreementMajorModNumber>"
"<tem:AgreementMinorModNumber>0</tem:AgreementMinorModNumber>"
"<tem:EnvironmentalEvaluationID>123456</tem:EnvironmentalEvaluationID>"
"<tem:IsPtfmAutoUpload>false</tem:IsPtfmAutoUpload>"
"<tem:IsDmsNewUpload>true</tem:IsDmsNewUpload>"
"<tem:IsCustomerUpload>false</tem:IsCustomerUpload>"
"<tem:IsDocumentInternalViewOnly>false</tem:IsDocumentInternalViewOnly>"
"<tem:UserHasExtendedWritePermissions>false</tem:UserHasExtendedWritePermissions>"
"<tem:DocumentData>VGhpcyBpcyBhIHNlY29uZCB0ZXN0</tem:DocumentData>"
"</tem:CMISDocument>"
"</tem:DocumentVersions>"
"<tem:CallingApplicationId>130</tem:CallingApplicationId>"
"<tem:AdministrativeAreaID>0</tem:AdministrativeAreaID>"
"<tem:AgreementMajorModNumber>0</tem:AgreementMajorModNumber>"
"<tem:AgreementMinorModNumber>0</tem:AgreementMinorModNumber>"
"<tem:EnvironmentalEvaluationID>123456</tem:EnvironmentalEvaluationID>"
"<tem:OfficeIDs>"
"<tem:int>60177</tem:int>"
"</tem:OfficeIDs>"
"<tem:CoreCustomerIDs>"
"<tem:int>1944131</tem:int>"
"</tem:CoreCustomerIDs>"
"<tem:SignatureIDs>"
"<tem:int>1</tem:int>"
"<tem:int>2</tem:int>"
"<tem:int>3</tem:int>"
"</tem:SignatureIDs>"
"<tem:NPADPlannedPracticeIDs>2744198</tem:NPADPlannedPracticeIDs>"
"<tem:EasementIDs></tem:EasementIDs>"
"<tem:NPADClientIDs></tem:NPADClientIDs>"
"<tem:FarmUnitNumbers></tem:FarmUnitNumbers>"
"<tem:IsPtfmAutoUpload>false</tem:IsPtfmAutoUpload>"
"<tem:IsDmsNewUpload>true</tem:IsDmsNewUpload>"
"<tem:IsCustomerUpload>false</tem:IsCustomerUpload>"
"<tem:IsDocumentInternalViewOnly>false</tem:IsDocumentInternalViewOnly>"
"<tem:UserHasExtendedWritePermissions>false</tem:UserHasExtendedWritePermissions>"
"<tem:DocumentAgreements>"
"<tem:CMISObjectAgreement>"
"<tem:AgreementItems></tem:AgreementItems>"
"</tem:CMISObjectAgreement>"
"</tem:DocumentAgreements>"
"<tem:DocumentData>VGhpcyBpcyBhIHNlY29uZCB0ZXN0</tem:DocumentData>"
"<tem:DocumentProperties>"
"<tem:CMISObjectProperty>"
"<tem:PropertyValue></tem:PropertyValue>"
"<tem:IsMultiValueProperty>true</tem:IsMultiValueProperty>"
"<tem:PropertyValues>"
"<tem:anyType></tem:anyType>"
"</tem:PropertyValues>"
"</tem:CMISObjectProperty>"
"</tem:DocumentProperties>"
"</tem:uploadDocument>"
"<tem:operationType>NewOrVersion</tem:operationType>"
"<tem:documentSignatures></tem:documentSignatures>"
"<tem:isLocked>false</tem:isLocked>"
"</tem:uploadDocumentWithOperation>"
"</soap:Body>"
"</soap:Envelope>",
//"SOAPAction=",
//"ResponseParam=result",
//"Snapshot=t1732742739.inf",
LAST);

return 0;
}

NOTE: The same request returns 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 please help me with this issue?

Thank you 

Mohammed Hussain

Comment List
Related
Recommended