Skip to main content

Posts

Showing posts from December, 2020

Making SOAP Requests with Postman

  Even after following what is mentioned here: https://learning.postman.com/docs/sending-requests/supported-api-frameworks/making-soap-requests/ i.e., set Content-Type = text/xml in the Headers and setting POST as a call, at times we get 500 internal server error or bad request with the message like " error message: The message with Action '' cannot be processed at the receiver... " So, what are we missing here? Setting SOAPAction in Headers is worth giving a try... How do we get that? 1. Open your WSDL in a browser with the service URL appended by “?WSDL" and find soapAction for which you want to execute your SOAP call. Like for the "Add" method in http://www.dneonline.com/calculator.asmx?WSDL , soapAction should be set to http://tempuri.org/Add 2. Copy the value of soapAction attribute of your SOAP method. Add a new key, provide Key as “SOAPAction” and the value that you copied in the above step i.e., http://tempuri.org/Add 3. Set “Content-Type” hea...

AWS Signature with RestAssured

  AWS Signature authentication support is not something that is available in RestAssured as out-of-box feature. At least I wasn't able to find any good documentation for the same. So, how we can implement AWS Signature Headers with Rest Assured? Signing AWS requests with Signature Version 4... This explains step by step how to create a signature and add it to an HTTP request to AWS: https://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html Below given source code (AWSV4Auth.java) helps to calculate signature based on given data and return the headers. Once you get headers suing aWSV4Auth.getHeaders(), you just need to add these headers in your Rest API call (Sample for the same is given below: RATest.java) AWSV4Auth.java: public class AWSV4Auth {     private AWSV4Auth() {     }     public static class Builder {         private String accessKeyID;         private String secretAccessKey;      ...