Skip to content

Suggested feature: SOAP response headers #242

@thebeatlecoder

Description

@thebeatlecoder

Hi, thanks for creating this awesome plugin!

I've started using it to create a remote simulator for a 3rd party SOAP service, so that I can stub canned responses for my acceptance tests. It works great so far but one limitation I hit today is is that currently I can only specify a SOAP response body for each operation. Ideally I would be able to specify some SOAP response headers too. The 3rd party service I'm simulating uses response headers to specify stuff like error codes, so as things stand, I don't think I can replicate that using this plugin.

It would be cool if I could do something like this when specifying a service:

export class SoapServiceSimulator {
  someOperation() {
    return {
      headers: {
        foo: 'bar'
      },
      body: {
        foo: 'bar'
      }
    }
  }
}

In order to get this response back from the SOAP server:

<soap:Envelope soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding" xmlns:soap="http://www.w3.org/2001/12/soap-envelope">
  <soap:Header>
      <foo>bar</foo>
   </soap:Header>
   <soap:Body>
      <foo>bar</foo>
   </soap:Body>
</soap:Envelope>

Do you think this would be useful and warrants a PR?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions