Skip to content

Conversation

@clx-jlmoreno
Copy link

Add SOAP 1.1/1.2 Proxy Enhancement with Action-Based Differentiation

Summary

This PR adds SOAP-aware proxy capabilities to the Imposter CLI, enabling proper capture and differentiation of SOAP 1.1 and 1.2 requests based on their SOAPAction header or action attribute.

Changes

  • New --soap1.1 flag for imposter proxy command to enable SOAP-aware mode
  • New --insecure flag to skip TLS certificate verification for HTTPS upstream servers
  • Action-based request differentiation: Captures SOAP requests using the action identifier instead of just the URI path, preventing duplicate overwrites when multiple SOAP operations share
    the same endpoint
  • Enhanced SOAP parsing: Extracts SOAPAction from headers (SOAP 1.1) or from the envelope namespace (SOAP 1.2)
  • Updated documentation: Added SOAP proxy examples and new flags in README.md
  • Comprehensive test coverage: Added unit tests for SOAP action extraction and proxy behavior

Usage Examples

shell

SOAP 1.1/1.2 proxy

imposter proxy --soap1.1 http://soap-service.example.com/service

Skip TLS verification for HTTPS endpoints

imposter proxy --insecure https://soap-service.example.com/service

This will capture SOAP requests and generate separate response files for each SOAP action, rather than overwriting the same endpoint file.

Note on Dockerfile

A Dockerfile has been included in this PR as we weren't certain about the official image publishing process for Imposter. If this conflicts with your existing build pipeline or is unnecessary,
please feel free to remove it or provide guidance on the preferred approach.

Testing

All existing tests pass, and new tests have been added to verify SOAP action extraction and proxy recording behavior.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main outofcoffee/imposter Docker images include the CLI already.

You can extend from them and run imposter <some command> within your container.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that, i should remove the self Dockerfile included in project due to is in main outofcoffe/imposter project.

Was not so clear for me how the different projects are joined between them, u usually works in maven projects multimodule or angular "monorepo" solutions, but it is my first experience mergering go parts and kotlin parts.

if options.Soap11Mode {
// In SOAP mode, use SOAPAction + path for uniqueness
soapAction := extractSoapAction(exchange.Request)
requestHash = getRequestHash(exchange.Request) + "_" + soapAction
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to extend the getRequestHash function to be a variadic function and take one or more strings to include in the hash computation. In SOAP mode, we can pass the SOAPAction, and nothing in the normal case.

}
}
resource.RequestHeaders = &headers
} else if options.Soap11Mode {
Copy link
Contributor

@outofcoffee outofcoffee Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we rework this if..else if block to be:

if len(req.Header) > 0 {
  if options.CaptureRequestHeaders {
    // existing logic
  } else if options.Soap11Mode {
    // new logic
  }
}

ignoreDuplicateRequests bool
recordOnlyResponseHeaders []string
flatResponseFileStructure bool
soap11Mode bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's name this soapMode with the flag --soap since it supports both SOAP 1.1 and 1.2.

recordOnlyResponseHeaders []string
flatResponseFileStructure bool
soap11Mode bool
insecure bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's name this insecureHttps with flag --insecure-https to clarify what we mean by insecure.

"strings"
)

// extractSoapAction extracts the SOAPAction header from the request or Content-Type action parameter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please could we have a unit test just for extractSoapAction in a files_test.go for this?

@outofcoffee outofcoffee changed the title Feature/soap proxy enhancement feat: adds SOAP support to proxy recorder Dec 17, 2025
@outofcoffee outofcoffee added the enhancement New feature or request label Dec 17, 2025
@outofcoffee
Copy link
Contributor

Hi @clx-jlmoreno, thank you for raising this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants