APIs that comply with the WS-Addressing specification can reliably send messages to their intended recipients. If you’ve ever used a third-party service and had your messages go missing, you know how important this is. Furthermore, if your organization is subject to auditing and regulatory compliance, you’ll likely need to prove your APIs are compliant as a part of your documentation. In this article, we’ll detail everything you need to know about WS-Addressing in Ready APIs.
What is WS-Addressing?
Web services are frequently used for business-to-business communication. As part of this communication, the benefits must be able to reliably send and receive messages without becoming confused about where they came from and where they are going. The Web Services Addressing (WS-Addressing) specification was created by the Web Services Interoperability Organization (WS-I) to address the issue of reliability in web services. The specification defines a set of addressing standards that allow services to deliver messages to the appropriate recipients and identify themselves to the recipients.
How do you build a compliant API with WS-Addressing?
The first step toward building a compliant API with WS-Addressing is to create a service endpoint. The endpoint will be responsible for receiving messages from clients. You'll need to assign a unique address to the endpoint and designate it as a service provider. Once this is done, your endpoint will be able to receive messages from clients. You'll need to define binding to specify how these messages should be routed and delivered to the endpoint. The binding will contain an addressing scheme that tells the endpoint how to receive notifications.
Creating an assertion
The communication between consumer and provider in SOAP is done with the help of WSDL (Web Services Description Language).
Add WSDL and create a project.
Run the request after adding Test Suite, Test Case, and Test steps.
Creating an assertion request for WS Addressing
Go to the log tab and click on 'Add Insertions' at the top of it.
Now, in the 'Add Assertion' Dialog, select the ‘Compliance, Status and Standards' category.
Under this category of assertions, choose 'WS Addressing Request.’
WS Addressing Request examines the most recent request to see if WS Addressing Headers are correct.
Under the WS Addressing Request log, you can checklist the properties to be asserted for validation in accordance with your requirements. The properties include:
'wsa:Action' for validating if the required action exists.
'wsa:To' for validating if the destination exists.
'wsa:Reply' for validating if the reply endpoint exists.
'wsa:MessageId' for validating if the required action exists.
Creating an Assertion Response for WS Addressing
Go to the log tab and click on 'Add Insertions' at the top of it.
Now, in the 'Add Assertion' Dialog, select the ‘Compliance, Status and Standards' category.
Under this category of assertions, choose 'WS Addressing Response.’
WS Addressing Response examines the most recent response to see if WS Addressing Headers are correct.
5. Under the WS Addressing Response log, you can checklist the properties to be asserted for validation under your requirements. The properties include:
'wsa:Action' for validating if the required action exists.
'wsa:To' for validating if the destination exists.
'wsa:RelatesTo' for validating the ID of the message to which the current message associates.
'wsa:ReplyTo' for validating if the reply endpoint exists.
'wsa:FaultTo' for validating if the fault endpoint exists.
Creating WS-Security Status Assertion
Go to the log tab and click on 'Add Insertions' at the top of it.
Now, in the 'Add Assertion' Dialog, select the 'Compliance, Status, and Standards' category.
Under this category of assertions, choose 'WS Security Status.'
WS Security Status examines the most recent response to see if WS Security Headers are correct.
The WS Security Status assertion is only applicable to SOAP Requests.
The XML Behind WS-Addressing Compliance Assertions
Every WS-Addressing compliant API has a binding. The binding contains an addressing scheme that specifies how messages should be delivered to the endpoint. The addressing system is defined using an XML document similar to the following. The wsa:Address> element contains an address used by the endpoint to receive messages. The address may be either a Uniform Resource Identifier (URI) or a URL. The wsa:To> element specifies the recipients of the message. It contains a wsa:Address> element that identifies where the message should be received. The wsa:From> element specifies the sender of the message. It also contains an wsa: Address> element that identifies where the message originated.
Frequently Asked Questions
Describe the API framework.
A platform for creating software applications is known as a framework or software framework. A software developer can construct apps for a particular platform on an API framework as a base. As an illustration, a framework may contain predefined classes and functions that can be used to handle hardware devices, process input, and communicate with system software.
What is Binding in context to WS-Addressing compliant API?
Every WS-Addressing compliant API has a binding. The binding contains an addressing scheme that specifies how messages should be delivered to the endpoint. The addressing system is defined using an XML document.
What are the typical API tests that are run?
Here are some of the typical API tests that are run:
Based on the request, the API response needs to be checked. We'll make sure the return value is in accordance with the request. We should check to make sure the system is authenticating the results whenever an API updates a data structure. We will check to see if the API requests another API or triggers another event. When no value is returned, the API's behaviour will be examined.
Does an API tester need to know how to code in order to carry out API testing?
Both manual and automated API testing is available. A tester does not need to be a programmer to conduct manual testing. To test the system, we simply need the API request's headers, payload, credentials, and information on how to utilise the necessary tools. However, to automate test cases and create a complex, optimised test suite, a tester must be proficient in programming.
Conclusion
We have briefly discussed Compliance Assertions - WS Addressing in Ready API along with the topics including creation of assertion request, assertion response and security status assertion for WS Addressing. We hope that we have helped you gain a better grip over the topic of Compliance Assertions - WS Addressing in Ready API with the help of this article.
Visit our website to read more such blogs. Make sure that you enroll in the courseswe provide, take mock tests, solve problems available, and interview puzzles. Also, you can pay attention to interview stuff- interview experiences and an interview bundle for placement preparations. Do upvote our blog to help fellow ninjas grow.