static final QName METHOD2_OUTPUT = new QName("urn:switchyard-metadata-wsdl", "sayHelloResponse");
static final QName METHOD3_INPUT = new QName("urn:switchyard-metadata-interface", "helloWS");
@Test
public void interfaceWSDLService() throws Exception {
WSDLService wsdlService = WSDLService.fromWSDL("HelloWebService.wsdl", "HelloWebService");
Assert.assertEquals("{urn:switchyard-metadata-wsdl}HelloWebService", wsdlService.getPortType().toString());
// There should be two operations
Assert.assertEquals(2, wsdlService.getOperations().size());
// method1 is InOnly
ServiceOperation method1 = wsdlService.getOperation("helloWS");
Assert.assertNotNull(method1);
Assert.assertEquals(method1.getInputType(), METHOD1_INPUT);
Assert.assertEquals(method1.getExchangePattern(), ExchangePattern.IN_ONLY);
//method2 is InOut
ServiceOperation method2 = wsdlService.getOperation("sayHello");
Assert.assertNotNull(method2);
Assert.assertEquals(method2.getInputType(), METHOD2_INPUT);
Assert.assertEquals(method2.getOutputType(), METHOD2_OUTPUT);
Assert.assertEquals(method2.getExchangePattern(), ExchangePattern.IN_OUT);
}