Go to file
2021-04-09 22:03:56 +01:00
.mvn/wrapper simple soap emulation mock; initial commit 2021-04-08 20:45:09 +01:00
src add xml document parsing; clean up typos 2021-04-09 22:03:56 +01:00
.gitignore simple soap emulation mock; initial commit 2021-04-08 20:45:09 +01:00
mvnw simple soap emulation mock; initial commit 2021-04-08 20:45:09 +01:00
mvnw.cmd simple soap emulation mock; initial commit 2021-04-08 20:45:09 +01:00
pom.xml simple soap emulation mock; initial commit 2021-04-08 20:45:09 +01:00
README.md added readme 2021-04-08 20:55:32 +01:00

SOAPMOCK

This is a demo springboot project, that shows how you can emulate the behavior of a soap web service as a black box. I have written it to be compatible with Java 1.8. So, it should work well with older systems.

Build:

mvn clean install

Run:

mvn spring-boot:run

The server will start on http://localhost:8080

Configure your client (Postman, Insomnia, or whatever) to send this body in a POST to url /call1:

<?xml version = "1.0"?>
<SOAP-ENV:Envelope
        xmlns:SOAP-ENV = "http://www.w3.org/2001/12/soap-envelope"
        SOAP-ENV:encodingStyle = "http://www.w3.org/2001/12/soap-encoding">

    <SOAP-ENV:Body xmlns:m = "http://www.xyz.org/quotations">
        <m:GetQuotation>
            <m:QuotationsName>MicroSoft</m:QuotationsName>
        </m:GetQuotation>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

You should get this in response:

<?xml version = "1.0"?>
<SOAP-ENV:Envelope
  xmlns:SOAP-ENV = "http://www.w3.org/2001/12/soap-envelope"
        SOAP-ENV:encodingStyle = "http://www.w3.org/2001/12/soap-encoding">
  <SOAP-ENV:Body
    xmlns:m = "http://www.xyz.org/quotations">
    <m:GetQuotationResponse>
      <m:Quotation>Here is the quotation</m:Quotation>
    </m:GetQuotationResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>