3 Replies Latest reply on Mar 23, 2016 10:25 AM by nicolas duminil

    How to test a SOAP binding

    nicolas duminil Master



      In a composite, I have a service exposing a WSDL interface and having a SOAP binding. The service has a reference to a component with a JPA binding. In order to test the composite, I deploy it and I use SoapUI. But I'm wondering how to test it using the Switchyard test kit or Arquillian ?

      Using the Switchyard test kit, as follows:



      @SwitchYardTestCaseConfig(config = SwitchYardTestCaseConfig.SWITCHYARD_XML, mixins = { CDIMixIn.class })

      public class PaymentTest {


        private Invoker service;



        public void testMakePayment() throws Exception {

          Invoice invoice = new Invoice("companyName", new Integer(160), new BigDecimal(75), new Integer(35));




      raises javax.persistence.PersistenceException: No Persistence provider for EntityManager. This must be obviously because the Switchyard test kit uses jetty who, as opposed to EAP/WildFly, doesn't provide any EntityManager instance. It should be created using an EntityManager factory, like in non Java EE applications.

      Trying to test with Arquillian, as follows:



      public class ArquillianPaymentTest1 {



        public static JavaArchive createDeployment() {

          return ShrinkWrap.createFromZipFile(JavaArchive.class, new File("target/switchyard-demo-0.0.1-SNAPSHOT.jar"));




        public void test() throws MalformedURLException {

          Service service = Service.create(new URL ("http://localhost:8080/pay/Payment?wsdl"), new QName("...", "Payment"));

          Invoice invoice = new Invoice("companyName", new Integer(160), new BigDecimal(75), new Integer(35));




      correctly starts the EAP managed container, deploys the composite as shown below:


      19:31:40,549 INFO  [org.jboss.ws.cxf.metadata] (MSC service thread 1-1) JBWS024061: Adding service endpoint metadata: id=Payment








      but raises the following exception:

      19:31:42,752 SEVERE [org.jboss.arquillian.protocol.jmx.JMXTestRunner] (pool-1-thread-1) Failed: ... ArquillianPaymentTest.test: javax.xml.ws.WebServiceException: Service endpoint interface class ... Payment does not have a javax.jws.WebService annotation.

      which is, of course, true.

      So, is there anyway I could test in container this service, using either Switchyard test kit, or Arquillian, or a combination of both ?

      Many thanks in advance,