@Test public void nonQualifiedPortName() throws Exception { PortName portName = new PortName("HelloWebServicePortFrench"); Service service = WSDLUtil.getService("MultiplePortService.wsdl", portName); Assert.assertNotNull(service); Assert.assertEquals( service.getQName(), new QName("urn:switchyard-component-soap:test-ws:1.0", "GoodbyeWebService")); service = WSDLUtil.getService("MultiplePortService.wsdl", new PortName("HelloWebService:")); Assert.assertNotNull(service); Assert.assertEquals( service.getQName(), new QName("urn:switchyard-component-soap:test-ws:1.0", "HelloWebService")); Port port = WSDLUtil.getPort(service, portName); Assert.assertEquals(port.getName(), "HelloWebServicePortFrench"); }
@Test(expected = WSDLException.class) public void nonExistentPortName() throws Exception { Service service = WSDLUtil.getService("MultiplePortService.wsdl", new PortName("HelloWebService:")); Assert.assertNotNull(service); Assert.assertEquals( service.getQName(), new QName("urn:switchyard-component-soap:test-ws:1.0", "HelloWebService")); WSDLUtil.getPort(service, new PortName("HelloWebServiceSpanishPort")); }
@Test public void soapAction() throws Exception { Service service = WSDLUtil.getService("HelloWebService.wsdl", new PortName("HelloWebService:")); Assert.assertNotNull(service); Assert.assertEquals( service.getQName(), new QName("urn:switchyard-component-soap:test-ws:1.0", "HelloWebService")); Port port = WSDLUtil.getPort(service, new PortName("HelloWebServicePort")); Assert.assertNotNull(port); String action = WSDLUtil.getSoapAction(port, "sayHello"); Assert.assertEquals(action, "uri:something:that:needs#tobevalid"); action = WSDLUtil.getSoapAction(port, "helloWS"); Assert.assertEquals(action, ""); }
@Test(expected = WSDLException.class) public void nonExistentService() throws Exception { WSDLUtil.getService("MultiplePortService.wsdl", new PortName("NonexistentWebService:")); }