I want the unit-test mapper objects to display / translate the web service types generated by wsimport into my own domain objects. I also want to test error scenarios such as SOAP errors, etc., and I think it would be better to check mapper objects on authentic SOAP responses. I donβt want to launch requests to the web service itself, since this requires access to the web service, and for each test, round-trip time is created.
Given this scenario, I am trying to decouple the SOAP messages from a specific XML file containing the SOAP envelope. I want to untie the SOAP envelope and, in turn, the payload in the body of the corresponding Java types.
I managed to unleash the payload using JAXB unmarshalling, but I did not find a way to allow me to handle SOAP responses with SOAP errors.
Is there an approach that gives a SOAP Envelope XML file that will allow me to easily check my mappers?
source share