jeudi 1 novembre 2018

How to test SOAP web-service without SOAP UI?

Collegues, I have a test:

@RunWith(SpringRunner.class)
@SpringBootTest
@ActiveProfiles("dev")
public class ServiceIFTest {


@Autowired
ServiceIF ServiceIF; /*this is web service endpoint bean */

    @Test
    public void createMonIntBalTranDoc() {
        TranDocReq parameter = new TranDocReq();
        /*set variables*/
        CreateTranDocRes tranDoc = serviceIF.createTranDoc(parameter);
        assertNotEquals(java.util.Optional.ofNullable(tranDoc.getId()), 0);

    }
}

it is a simple Junit test where i check class field value.

But I need to do an integration test, i would like to check an XML which service will return to client. At the current moment if found quite old article https://www.ibm.com/developerworks/webservices/tutorials/ws-soa-autotest2/ws-soa-autotest2.html where author recommend to write client etc...

So question is how to test integration between soap web service and client from Java project? In other words, i need to check the XML response returned by my web service.

P.s. Some years ago I did it with SOAP UI and groovy. Also, I tried to use jaxbToString converter, but it cut namespaces.

Aucun commentaire:

Enregistrer un commentaire