Validate Incoming Messages

Last modified by Erik Bakker on 2024/08/26 12:39

In this microlearning, we'll dive into configuring validation for your SOAP web service. We'll focus on how to ensure that incoming XML messages meet your specified criteria using XSD for validation. Proper validation helps guarantee that the messages your service handles are both accurate and well-formed. By the end of this session, you'll understand how to set up and manage validation effectively within your SOAP web service configuration.

If you have any questions, don't hesitate to contact academy@emagiz.com.

1. Prerequisites

  • Basic knowledge of the eMagiz platform

2. Key concepts

This microlearning centers around configuring your SOAP web service.

By configuring, we mean: Designing and determining the characteristics of the SOAP web service.

Crucial parts in the configuration are:

  • Operation Name
  • SOAP Webservice Namespace
  • Validation
  • Authentication

Of these four points, we will zoom in on the validation part of our SOAP Webservice in this microlearning.

3. Validate Incoming Messages

When setting up a point at which your customers can talk to you, eMagiz offers various methods of creating such a point. One of those options is to host a SOAP Webservice in eMagiz that handles XML messages asynchronously or synchronously. In this microlearning, we will zoom in on the part that validation of the messages plays when offering such a SOAP web service.

Crucial parts in the configuration are:

  • Operation Name
  • SOAP Webservice Namespace
  • Validation
  • Authentication

Of these four points, we will zoom in on the validation part of our SOAP Webservice in this microlearning. The SOAP Webservice serves as a point of entry where people with the proper credentials (security) and the correct answers (validation) can enter and perform their actions. In the previous microlearning, we talked about the validation part. In this microlearning, we talk about the security part.

3.1 Configuration on system message level in Design

As you have learned from the crash course, you can validate an XML message with the help of an XSD. This XSD describes data types, order, associations, and length of attributes. You can use such an XSD to validate what your clients send you. eMagiz will automatically define a WSDL based on the combination of system messages you provide for each operation you want to host. To ensure that the WSDL is created correctly, don't forget to add an entity called "Send{givenname}Request" to the (request) system message and an entity called "Send{givenname}Response" in case you have a response system message. An example of how this needs to be configured in Design is shown below.

novice-soap-webservice-connectivity-validate-incoming-messages-gen3--root-entity-for-wsdl.png

3.2 Effect in Create

In the infra flow, eMagiz automatically adds a support object of the "Dynamic WSDL" type. In this support object, the link is made between the system message definitions and the WSDL that will be created based on this.

novice-soap-webservice-connectivity-validate-incoming-messages-gen3--dynamic-wsdl-support-object-infra.png

Warning

Note that when you make changes to the system message after the integration is already in Create, or when you add a new integration to Create, you need to create a new version of your infra flow to be able to deploy the changes to your WSDL.

With this done, you have successfully added validation to your SOAP web service.

4. Key takeaways

  • Crucial parts in the configuration are:
    • Operation Name
    • SOAP Webservice Namespace
    • Validation
    • Authentication
  • Validation is done with the help of an XSD
  • The WSDL is used for external documentation
  • eMagiz will automatically generate the WSDL for you based on your system messages
    • Do not forget to add the correct root entity to your system message to make the WSDL work

5. Suggested Additional Readings