Skip to content

Conversation

clx-jlmoreno
Copy link

SOAP-Aware Proxy Implementation Summary

Overview

We've successfully implemented a SOAP-aware proxy for Imposter that properly handles SOAP 1.1 services which use the SOAPAction header to differentiate between operations on the same endpoint.

Implementation Details

1. Enhanced UpstreamService

We created a SoapAwareUpstreamService that extends the existing proxy functionality with SOAP awareness:

  • Extracts the SOAPAction header from incoming requests
  • Generates unique filenames based on the SOAPAction value
  • Saves requests and responses with operation-specific names
  • Creates configuration files for each SOAP operation

2. Configuration Integration

We integrated the SOAP-aware functionality with the existing configuration system:

  • Added a soapMode flag to ImposterConfig
  • Added a --soap command-line parameter to enable SOAP-aware mode
  • Modified the HandlerServiceImpl to use the appropriate service based on the mode

3. Compatibility

The implementation maintains backward compatibility:

  • Standard proxy functionality works as before when --soap is not specified
  • The SOAP-aware proxy is only used when explicitly enabled
  • All existing features continue to work as expected

Benefits

  1. Operation-specific captures: Each SOAP operation gets its own request/response pair saved
  2. Automatic configuration: Generated configuration files include SOAPAction header matching
  3. Organized files: Clear naming convention makes it easy to identify which files correspond to which operations
  4. Seamless integration: Works with existing proxy functionality through a command-line flag

Testing

The implementation has been tested with:

  1. Building the project successfully
  2. Creating a custom Docker image with the changes
  3. Running the container with the SOAP-aware proxy enabled
  4. Verifying the command-line parameters work correctly

Next Steps

  1. Add comprehensive tests for the SOAP-aware proxy functionality
  2. Enhance error handling and edge cases
  3. Add support for SOAP 1.2 which uses Content-Type header instead of SOAPAction
  4. Consider adding more configuration options for file naming and organization

@outofcoffee
Copy link
Collaborator

Hi @clx-jlmoreno, thanks very much for submitting this patch.

We'll look at how we can include this into the proxy package in imposter-cli, which is where the existing proxy/record functionality is implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants