News KrakenD Enterprise v2.6 released with OpenTelemetry, FIPS-140, gRPC server and more

Modernizing your legacy SOAP services with KrakenD

by Albert Garcia

Jun 27, 2023

4 min read
post image

We are thrilled to introduce one of our latest features: SOAP integration. This powerful integration is designed to help businesses modernize their legacy SOAP systems without the need for extensive modifications.

Understanding SOAP and Its Limitations

SOAP (Simple Object Access Protocol) is a protocol specification for exchanging structured information in web services using XML. It operates over HTTP for simplicity and compatibility, but also supports other protocols such as SMTP. SOAP’s primary application is in large-scale enterprise environments with high security and transactional requirements.

However, SOAP has its limitations:

  • Verbosity: SOAP uses XML for its message format, which can be quite verbose and lead to larger message sizes. This can increase bandwidth usage and slow down the parsing process.
  • Complexity: SOAP is protocol-agnostic, which means it can operate over any transport protocol. While this can be an advantage, it also leads to increased complexity in handling different protocols.
  • Tight Coupling: SOAP services are tightly coupled, meaning that any change in the service can potentially break the client, and vice versa. This can make versioning and maintaining SOAP services challenging.

The Power of REST APIs and Their Adoption

REST (Representational State Transfer) APIs have become the standard for web services in today’s modern and open data world. They operate over HTTP(s) and use standard HTTP methods like GET, POST, PUT, DELETE, etc., to perform operations.

The benefits of REST APIs include:

  • Simplicity: REST APIs use JSON as their primary data format, which is simpler and more compact than XML. This leads to smaller message sizes and faster parsing.
  • Scalability: REST APIs are stateless, meaning each request from the client to the server must contain all the information needed to understand and process the request. This stateless nature allows REST APIs to be easily scaled by adding more servers as needed.
  • Cacheability: Responses from REST APIs can be cached on the client-side, reducing the load on the server and improving performance.
  • Loose Coupling: REST APIs are loosely coupled, meaning changes in the service are less likely to break the client. This makes versioning and maintaining REST APIs easier.

Moreover, the adoption rate of REST APIs has significantly outpaced SOAP in recent years. REST’s compatibility with modern tools and technologies, along with its simplicity and scalability, has led to its wide adoption in the industry. Transitioning from SOAP to REST is not just a technical upgrade; it’s a strategic move towards aligning with industry standards and ensuring future compatibility and scalability.

Upgrading Legacy Systems with KrakenD’s SOAP Integration

That’s where KrakenD’s SOAP integration comes in. This feature allows businesses to expose their legacy SOAP systems as modern REST APIs without needing to modify the existing SOAP services.

This seamless transition offers several benefits:

  • Dynamic variable injection: The SOAP integration allows you to craft the body and XML content sent to a SOAP service by injecting dynamic variables from various sources such as the user’s body, headers, query strings, or URL parameters.
  • Seamless encoding transformations: KrakenD has the native ability to deal with multiple encodings like XML or JSON, and can transform one to the other transparently before returning the content to the user.
  • Flexible response manipulation: You can easily manipulate responses to achieve the desired output, regardless of the end user’s encoding or method.

KrakenD SOAP to REST integration

How to Use the SOAP Integration

To implement the SOAP integration, follow these steps:

  1. Decide the content type to return to the user (by default JSON) using output_encoding.
  2. Write the SOAP XML request to be sent for this endpoint, either in a separate file using the path parameter or directly embedding a base64-encoded template in your configuration file using the template parameter.
  3. Inject any necessary variables into the template.

Key Configuration Options

The SOAP integration offers several configuration options:

  • content_type: The Content-Type used in your template that will be sent to the SOAP server.
  • debug: When true, shows useful information in the logs with DEBUG level about the input received and the body generated. Do not enable in production.
  • path: The path to the Go template file you want to use to craft the body.
  • template: An inline base64 encoded Go template with the body XML content to send to the SOAP service.

Template Definition

Templates use the Golang template language to parse content. You can insert variables using the format {{ .variable }} that will replace the placeholder with the corresponding value. Available variables include:.req_body, .req_params, .req_headers, .req_querystring or .req_path.

In conclusion, KrakenD’s SOAP integration is a game-changer for companies looking to modernize their SOAP services. By providing seamless encoding transformations, dynamic variable injection, and flexible response manipulation, this powerful feature allows for a more efficient and user-friendly interface. Don’t miss out on the opportunity to enhance your SOAP services with KrakenD’s integration. Give it a try and experience the benefits first-hand, and see how it can revolutionize the way you work with SOAP services.

Read more in our documentation:


KrakenD’s SOAP integration is just one of the many time-saving features included in KrakenD Enterprise. Unlock this feature and explore other innovations that KrakenD Enterprise has to offer.
Contact us and elevate your API experience.

Scarf
 Stay up to date with KrakenD releases and important updates