Java Code Examples for org.apache.cxf.endpoint.Server#destroy()
The following examples show how to use
org.apache.cxf.endpoint.Server#destroy() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FragmentPutRemoveTest.java From cxf with Apache License 2.0 | 6 votes |
@Test public void removeAttrTest() throws XMLStreamException { String content = "<a foo=\"1\"/>"; ResourceManager resourceManager = new MemoryResourceManager(); ReferenceParametersType refParams = resourceManager.create(getRepresentation(content)); Server resource = createLocalResource(resourceManager); Resource client = createClient(refParams); Put request = new Put(); request.setDialect(FragmentDialectConstants.FRAGMENT_2011_03_IRI); Fragment fragment = new Fragment(); ExpressionType expression = new ExpressionType(); expression.setLanguage(FragmentDialectConstants.XPATH10_LANGUAGE_IRI); expression.setMode(FragmentDialectConstants.FRAGMENT_MODE_REMOVE); expression.getContent().add("/a/@foo"); fragment.setExpression(expression); request.getAny().add(fragment); PutResponse response = client.put(request); Element rootEl = (Element) response.getRepresentation().getAny(); Assert.assertNull(rootEl.getAttributeNode("foo")); resource.destroy(); }
Example 2
Source File: FragmentPutReplaceTest.java From cxf with Apache License 2.0 | 6 votes |
@Test(expected = SOAPFaultException.class) public void replaceNonExistingElementFailTest() throws XMLStreamException { String content = "<a/>"; ResourceManager resourceManager = new MemoryResourceManager(); ReferenceParametersType refParams = resourceManager.create(getRepresentation(content)); Server resource = createLocalResource(resourceManager); Resource client = createClient(refParams); Put request = new Put(); request.setDialect(FragmentDialectConstants.FRAGMENT_2011_03_IRI); Fragment fragment = new Fragment(); ExpressionType expression = new ExpressionType(); expression.setLanguage(FragmentDialectConstants.XPATH10_LANGUAGE_IRI); expression.getContent().add("//b"); Element replacedElement = DOMUtils.getEmptyDocument().createElement("b"); ValueType value = new ValueType(); value.getContent().add(replacedElement); fragment.setExpression(expression); fragment.setValue(value); request.getAny().add(fragment); client.put(request); resource.destroy(); }
Example 3
Source File: FragmentGetXPath10Test.java From cxf with Apache License 2.0 | 6 votes |
@Test public void getTest() throws XMLStreamException { String content = "<root><a><b>Text</b></a></root>"; ResourceManager resourceManager = new MemoryResourceManager(); ReferenceParametersType refParams = resourceManager.create(getRepresentation(content)); Server resource = createLocalResource(resourceManager); Resource client = createClient(refParams); ObjectFactory objectFactory = new ObjectFactory(); Get request = new Get(); request.setDialect(FragmentDialectConstants.FRAGMENT_2011_03_IRI); ExpressionType expression = new ExpressionType(); expression.setLanguage(FragmentDialectConstants.XPATH10_LANGUAGE_IRI); expression.getContent().add("/root/a/b"); request.getAny().add(objectFactory.createExpression(expression)); GetResponse response = client.get(request); ValueType value = getValue(response); Assert.assertEquals(1, value.getContent().size()); Assert.assertEquals("b", ((Element)value.getContent().get(0)).getLocalName()); resource.destroy(); }
Example 4
Source File: FragmentPutInsertBeforeTest.java From cxf with Apache License 2.0 | 6 votes |
@Test(expected = SOAPFaultException.class) public void insertBeforeAttrTest() throws XMLStreamException { String content = "<a foo=\"1\"/>"; ResourceManager resourceManager = new MemoryResourceManager(); ReferenceParametersType refParams = resourceManager.create(getRepresentation(content)); Server resource = createLocalResource(resourceManager); Resource client = createClient(refParams); Put request = new Put(); request.setDialect(FragmentDialectConstants.FRAGMENT_2011_03_IRI); Fragment fragment = new Fragment(); ExpressionType expression = new ExpressionType(); expression.setLanguage(FragmentDialectConstants.XPATH10_LANGUAGE_IRI); expression.setMode(FragmentDialectConstants.FRAGMENT_MODE_INSERT_BEFORE); expression.getContent().add("/a/@f"); Element addedElement = DOMUtils.getEmptyDocument().createElement("b"); ValueType value = new ValueType(); value.getContent().add(addedElement); fragment.setExpression(expression); fragment.setValue(value); request.getAny().add(fragment); client.put(request); resource.destroy(); }
Example 5
Source File: RESTLoggingTest.java From cxf with Apache License 2.0 | 6 votes |
@Test public void testEvents() throws MalformedURLException { LoggingFeature loggingFeature = new LoggingFeature(); loggingFeature.setLogBinary(true); TestEventSender sender = new TestEventSender(); loggingFeature.setSender(sender); Server server = createService(SERVICE_URI, new TestServiceRest(), loggingFeature); server.start(); WebClient client = createClient(SERVICE_URI, loggingFeature); String result = client.get(String.class); Assert.assertEquals("test1", result); List<LogEvent> events = sender.getEvents(); await().until(() -> events.size(), is(4)); server.stop(); server.destroy(); Assert.assertEquals(4, events.size()); checkRequestOut(events.get(0)); checkRequestIn(events.get(1)); checkResponseOut(events.get(2)); checkResponseIn(events.get(3)); }
Example 6
Source File: FragmentGetXPath10Test.java From cxf with Apache License 2.0 | 6 votes |
@Test public void getBooleanTrueTest() throws XMLStreamException { String content = "<root><a><b>Text</b><b>Text2</b></a></root>"; ResourceManager resourceManager = new MemoryResourceManager(); ReferenceParametersType refParams = resourceManager.create(getRepresentation(content)); Server resource = createLocalResource(resourceManager); Resource client = createClient(refParams); ObjectFactory objectFactory = new ObjectFactory(); Get request = new Get(); request.setDialect(FragmentDialectConstants.FRAGMENT_2011_03_IRI); ExpressionType expression = new ExpressionType(); expression.setLanguage(FragmentDialectConstants.XPATH10_LANGUAGE_IRI); expression.getContent().add("count(//b) = 2"); request.getAny().add(objectFactory.createExpression(expression)); GetResponse response = client.get(request); ValueType value = getValue(response); Assert.assertEquals(1, value.getContent().size()); Assert.assertEquals("true", value.getContent().get(0)); resource.destroy(); }
Example 7
Source File: ProtobufferExporter.java From fuchsia with Apache License 2.0 | 6 votes |
@Override protected void denyExportDeclaration(ExportDeclaration exportDeclaration) throws BinderException { ProtobufferExportDeclarationWrapper pojo = ProtobufferExportDeclarationWrapper.create(exportDeclaration); Server server = serverPublished.get(pojo.getId()); serverPublished.remove(pojo.getId()); if (server != null) { LOG.info("Destroying endpoint:" + server.getEndpoint().getEndpointInfo().getAddress()); server.destroy(); } else { LOG.warn("no endpoint to destroy"); } }
Example 8
Source File: FragmentGetXPath10Test.java From cxf with Apache License 2.0 | 6 votes |
@Test public void getWithNamespaceTest() throws XMLStreamException { String content = "<ns:root xmlns:ns=\"www.example.org\"><ns:a><ns:b>Text</ns:b></ns:a></ns:root>"; ResourceManager resourceManager = new MemoryResourceManager(); ReferenceParametersType refParams = resourceManager.create(getRepresentation(content)); Server resource = createLocalResource(resourceManager); Resource client = createClient(refParams); ObjectFactory objectFactory = new ObjectFactory(); Get request = new Get(); request.setDialect(FragmentDialectConstants.FRAGMENT_2011_03_IRI); ExpressionType expression = new ExpressionType(); expression.setLanguage(FragmentDialectConstants.XPATH10_LANGUAGE_IRI); expression.getContent().add("/ns:root/ns:a/ns:b"); request.getAny().add(objectFactory.createExpression(expression)); GetResponse response = client.get(request); ValueType value = getValue(response); Assert.assertEquals(1, value.getContent().size()); Assert.assertEquals("b", ((Element)value.getContent().get(0)).getLocalName()); Assert.assertEquals("www.example.org", ((Element)value.getContent().get(0)).getNamespaceURI()); resource.destroy(); }
Example 9
Source File: CXFITest.java From java-specialagent with Apache License 2.0 | 6 votes |
public static void main(final String[] args) { final String msg = "hello"; final JaxWsServerFactoryBean serverFactory = new JaxWsServerFactoryBean(); serverFactory.setAddress(BASE_URI); serverFactory.setServiceBean(new EchoImpl()); final Server server = serverFactory.create(); final JaxWsProxyFactoryBean clientFactory = new JaxWsProxyFactoryBean(); clientFactory.setServiceClass(Echo.class); clientFactory.setAddress(BASE_URI); final Echo echo = (Echo)clientFactory.create(); echo.echo(msg); // CXF Tracing span has no "component" tag, cannot use TestUtil.checkSpan() checkSpans(2); server.destroy(); serverFactory.getBus().shutdown(true); }
Example 10
Source File: FragmentPutReplaceTest.java From cxf with Apache License 2.0 | 5 votes |
@Test public void replaceElementTest() throws XMLStreamException { String content = "<root><a>Text</a></root>"; ResourceManager resourceManager = new MemoryResourceManager(); ReferenceParametersType refParams = resourceManager.create(getRepresentation(content)); Server resource = createLocalResource(resourceManager); Resource client = createClient(refParams); Put request = new Put(); request.setDialect(FragmentDialectConstants.FRAGMENT_2011_03_IRI); Fragment fragment = new Fragment(); ExpressionType expression = new ExpressionType(); expression.setLanguage(FragmentDialectConstants.XPATH10_LANGUAGE_IRI); expression.getContent().add("/root/a"); Element replacedElement = DOMUtils.getEmptyDocument().createElement("b"); replacedElement.setTextContent("Better text"); ValueType value = new ValueType(); value.getContent().add(replacedElement); fragment.setExpression(expression); fragment.setValue(value); request.getAny().add(fragment); PutResponse response = client.put(request); Element rootEl = (Element) response.getRepresentation().getAny(); Assert.assertEquals("b", rootEl.getChildNodes().item(0).getNodeName()); Assert.assertEquals("Better text", rootEl.getChildNodes().item(0).getTextContent()); resource.destroy(); }
Example 11
Source File: FragmentPutInsertAfterTest.java From cxf with Apache License 2.0 | 5 votes |
@Test public void insertAfter1Test() throws XMLStreamException { String content = "<a><b/><c/></a>"; ResourceManager resourceManager = new MemoryResourceManager(); ReferenceParametersType refParams = resourceManager.create(getRepresentation(content)); Server resource = createLocalResource(resourceManager); Resource client = createClient(refParams); Put request = new Put(); request.setDialect(FragmentDialectConstants.FRAGMENT_2011_03_IRI); Fragment fragment = new Fragment(); ExpressionType expression = new ExpressionType(); expression.setLanguage(FragmentDialectConstants.XPATH10_LANGUAGE_IRI); expression.setMode(FragmentDialectConstants.FRAGMENT_MODE_INSERT_AFTER); expression.getContent().add("/a/b"); Element addedElement = DOMUtils.getEmptyDocument().createElement("d"); ValueType value = new ValueType(); value.getContent().add(addedElement); fragment.setExpression(expression); fragment.setValue(value); request.getAny().add(fragment); PutResponse response = client.put(request); Element rootEl = (Element) response.getRepresentation().getAny(); Element child0 = (Element) rootEl.getChildNodes().item(0); Element child1 = (Element) rootEl.getChildNodes().item(1); Element child2 = (Element) rootEl.getChildNodes().item(2); Assert.assertEquals("a", rootEl.getNodeName()); Assert.assertEquals("b", child0.getNodeName()); Assert.assertEquals("d", child1.getNodeName()); Assert.assertEquals("c", child2.getNodeName()); resource.destroy(); }
Example 12
Source File: FragmentPutReplaceTest.java From cxf with Apache License 2.0 | 5 votes |
@Test public void replaceAttributeTest() throws XMLStreamException { String content = "<root><a foo=\"1\">Text</a></root>"; ResourceManager resourceManager = new MemoryResourceManager(); ReferenceParametersType refParams = resourceManager.create(getRepresentation(content)); Server resource = createLocalResource(resourceManager); Resource client = createClient(refParams); Put request = new Put(); request.setDialect(FragmentDialectConstants.FRAGMENT_2011_03_IRI); Fragment fragment = new Fragment(); ExpressionType expression = new ExpressionType(); expression.setLanguage(FragmentDialectConstants.XPATH10_LANGUAGE_IRI); expression.getContent().add("/root/a/@foo"); Element replacedAttr = DOMUtils.getEmptyDocument().createElementNS( FragmentDialectConstants.FRAGMENT_2011_03_IRI, FragmentDialectConstants.FRAGMENT_ATTR_NODE_NAME ); replacedAttr.setAttributeNS( FragmentDialectConstants.FRAGMENT_2011_03_IRI, FragmentDialectConstants.FRAGMENT_ATTR_NODE_NAME_ATTR, "bar" ); replacedAttr.setTextContent("2"); ValueType value = new ValueType(); value.getContent().add(replacedAttr); fragment.setExpression(expression); fragment.setValue(value); request.getAny().add(fragment); PutResponse response = client.put(request); Element rootEl = (Element) response.getRepresentation().getAny(); Element aEl = (Element) rootEl.getChildNodes().item(0); Assert.assertNotNull(aEl); String attribute = aEl.getAttribute("bar"); Assert.assertEquals("2", attribute); resource.destroy(); }
Example 13
Source File: FragmentPutInsertAfterTest.java From cxf with Apache License 2.0 | 5 votes |
@Test public void insertAfter2Test() throws XMLStreamException { String content = "<a><b/><b/></a>"; ResourceManager resourceManager = new MemoryResourceManager(); ReferenceParametersType refParams = resourceManager.create(getRepresentation(content)); Server resource = createLocalResource(resourceManager); Resource client = createClient(refParams); Put request = new Put(); request.setDialect(FragmentDialectConstants.FRAGMENT_2011_03_IRI); Fragment fragment = new Fragment(); ExpressionType expression = new ExpressionType(); expression.setLanguage(FragmentDialectConstants.XPATH10_LANGUAGE_IRI); expression.setMode(FragmentDialectConstants.FRAGMENT_MODE_INSERT_AFTER); expression.getContent().add("/a/b[last()]"); Element addedElement = DOMUtils.getEmptyDocument().createElement("c"); ValueType value = new ValueType(); value.getContent().add(addedElement); fragment.setExpression(expression); fragment.setValue(value); request.getAny().add(fragment); PutResponse response = client.put(request); Element rootEl = (Element) response.getRepresentation().getAny(); Element child0 = (Element) rootEl.getChildNodes().item(0); Element child1 = (Element) rootEl.getChildNodes().item(1); Element child2 = (Element) rootEl.getChildNodes().item(2); Assert.assertEquals("a", rootEl.getNodeName()); Assert.assertEquals("b", child0.getNodeName()); Assert.assertEquals("b", child1.getNodeName()); Assert.assertEquals("c", child2.getNodeName()); resource.destroy(); }
Example 14
Source File: FragmentPutReplaceTest.java From cxf with Apache License 2.0 | 5 votes |
@Test public void replaceDocument2Test() throws XMLStreamException { String content = "<a/>"; ResourceManager resourceManager = new MemoryResourceManager(); ReferenceParametersType refParams = resourceManager.create(getRepresentation(content)); Server resource = createLocalResource(resourceManager); Resource client = createClient(refParams); Put request = new Put(); request.setDialect(FragmentDialectConstants.FRAGMENT_2011_03_IRI); Fragment fragment = new Fragment(); ExpressionType expression = new ExpressionType(); expression.setLanguage(FragmentDialectConstants.XPATH10_LANGUAGE_IRI); expression.getContent().add("/*"); Element replacedElement = DOMUtils.getEmptyDocument().createElement("b"); ValueType value = new ValueType(); value.getContent().add(replacedElement); fragment.setExpression(expression); fragment.setValue(value); request.getAny().add(fragment); PutResponse response = client.put(request); Element rootEl = (Element) response.getRepresentation().getAny(); Assert.assertEquals("b", rootEl.getNodeName()); resource.destroy(); }
Example 15
Source File: FragmentPutInsertAfterTest.java From cxf with Apache License 2.0 | 5 votes |
@Test public void insertAfterEmptyDocTest() { ResourceManager resourceManager = new MemoryResourceManager(); ReferenceParametersType refParams = resourceManager.create(new Representation()); Server resource = createLocalResource(resourceManager); Resource client = createClient(refParams); Put request = new Put(); request.setDialect(FragmentDialectConstants.FRAGMENT_2011_03_IRI); Fragment fragment = new Fragment(); ExpressionType expression = new ExpressionType(); expression.setLanguage(FragmentDialectConstants.XPATH10_LANGUAGE_IRI); expression.setMode(FragmentDialectConstants.FRAGMENT_MODE_INSERT_AFTER); expression.getContent().add("/"); Element addedElement = DOMUtils.getEmptyDocument().createElement("a"); ValueType value = new ValueType(); value.getContent().add(addedElement); fragment.setExpression(expression); fragment.setValue(value); request.getAny().add(fragment); PutResponse response = client.put(request); Element rootEl = (Element) response.getRepresentation().getAny(); Assert.assertEquals("a", rootEl.getNodeName()); resource.destroy(); }
Example 16
Source File: FragmentGetXPath10Test.java From cxf with Apache License 2.0 | 5 votes |
@Test public void getAttrTest() throws XMLStreamException { String content = "<root><a><b attr1=\"value1\">Text</b></a></root>"; ResourceManager resourceManager = new MemoryResourceManager(); ReferenceParametersType refParams = resourceManager.create(getRepresentation(content)); Server resource = createLocalResource(resourceManager); Resource client = createClient(refParams); ObjectFactory objectFactory = new ObjectFactory(); Get request = new Get(); request.setDialect(FragmentDialectConstants.FRAGMENT_2011_03_IRI); ExpressionType expression = new ExpressionType(); expression.setLanguage(FragmentDialectConstants.XPATH10_LANGUAGE_IRI); expression.getContent().add("/root/a/b/@attr1"); request.getAny().add(objectFactory.createExpression(expression)); GetResponse response = client.get(request); ValueType value = getValue(response); Assert.assertEquals(1, value.getContent().size()); Assert.assertTrue(value.getContent().get(0) instanceof Element); Element attrEl = (Element) value.getContent().get(0); Assert.assertEquals(FragmentDialectConstants.FRAGMENT_ATTR_NODE_NAME, attrEl.getLocalName()); Assert.assertEquals(FragmentDialectConstants.FRAGMENT_2011_03_IRI, attrEl.getNamespaceURI()); Assert.assertEquals("attr1", attrEl.getAttribute(FragmentDialectConstants.FRAGMENT_ATTR_NODE_NAME_ATTR)); Assert.assertEquals("value1", attrEl.getTextContent()); resource.destroy(); }
Example 17
Source File: FragmentPutAddTest.java From cxf with Apache License 2.0 | 5 votes |
@Test public void addSiblingTest() throws XMLStreamException { String content = "<a><b/></a>"; ResourceManager resourceManager = new MemoryResourceManager(); ReferenceParametersType refParams = resourceManager.create(getRepresentation(content)); Server resource = createLocalResource(resourceManager); Resource client = createClient(refParams); Put request = new Put(); request.setDialect(FragmentDialectConstants.FRAGMENT_2011_03_IRI); Fragment fragment = new Fragment(); ExpressionType expression = new ExpressionType(); expression.setLanguage(FragmentDialectConstants.XPATH10_LANGUAGE_IRI); expression.setMode(FragmentDialectConstants.FRAGMENT_MODE_ADD); expression.getContent().add("/a"); Element addedElement = DOMUtils.getEmptyDocument().createElement("c"); ValueType value = new ValueType(); value.getContent().add(addedElement); fragment.setExpression(expression); fragment.setValue(value); request.getAny().add(fragment); PutResponse response = client.put(request); Element rootEl = (Element) response.getRepresentation().getAny(); Element child0 = (Element) rootEl.getChildNodes().item(0); Element child1 = (Element) rootEl.getChildNodes().item(1); Assert.assertEquals("a", rootEl.getNodeName()); Assert.assertEquals("b", child0.getNodeName()); Assert.assertEquals("c", child1.getNodeName()); resource.destroy(); }
Example 18
Source File: FragmentPutInsertBeforeTest.java From cxf with Apache License 2.0 | 5 votes |
@Test public void insertBefore2Test() throws XMLStreamException { String content = "<a><b/><b/></a>"; ResourceManager resourceManager = new MemoryResourceManager(); ReferenceParametersType refParams = resourceManager.create(getRepresentation(content)); Server resource = createLocalResource(resourceManager); Resource client = createClient(refParams); Put request = new Put(); request.setDialect(FragmentDialectConstants.FRAGMENT_2011_03_IRI); Fragment fragment = new Fragment(); ExpressionType expression = new ExpressionType(); expression.setLanguage(FragmentDialectConstants.XPATH10_LANGUAGE_IRI); expression.setMode(FragmentDialectConstants.FRAGMENT_MODE_INSERT_BEFORE); expression.getContent().add("/a/b[1]"); Element addedElement = DOMUtils.getEmptyDocument().createElement("c"); ValueType value = new ValueType(); value.getContent().add(addedElement); fragment.setExpression(expression); fragment.setValue(value); request.getAny().add(fragment); PutResponse response = client.put(request); Element rootEl = (Element) response.getRepresentation().getAny(); Element child0 = (Element) rootEl.getChildNodes().item(0); Element child1 = (Element) rootEl.getChildNodes().item(1); Element child2 = (Element) rootEl.getChildNodes().item(2); Assert.assertEquals("a", rootEl.getNodeName()); Assert.assertEquals("c", child0.getNodeName()); Assert.assertEquals("b", child1.getNodeName()); Assert.assertEquals("b", child2.getNodeName()); resource.destroy(); }
Example 19
Source File: FragmentPutAddTest.java From cxf with Apache License 2.0 | 5 votes |
@Test(expected = SOAPFaultException.class) public void addExistingAttributeTest() throws XMLStreamException { String content = "<a foo=\"1\"/>"; ResourceManager resourceManager = new MemoryResourceManager(); ReferenceParametersType refParams = resourceManager.create(getRepresentation(content)); Server resource = createLocalResource(resourceManager); Resource client = createClient(refParams); Put request = new Put(); request.setDialect(FragmentDialectConstants.FRAGMENT_2011_03_IRI); Fragment fragment = new Fragment(); ExpressionType expression = new ExpressionType(); expression.setLanguage(FragmentDialectConstants.XPATH10_LANGUAGE_IRI); expression.setMode(FragmentDialectConstants.FRAGMENT_MODE_ADD); expression.getContent().add("/a"); Document doc = DOMUtils.getEmptyDocument(); Element addedAttr = doc.createElementNS( FragmentDialectConstants.FRAGMENT_2011_03_IRI, FragmentDialectConstants.FRAGMENT_ATTR_NODE_NAME ); addedAttr.setAttributeNS( FragmentDialectConstants.FRAGMENT_2011_03_IRI, FragmentDialectConstants.FRAGMENT_ATTR_NODE_NAME_ATTR, "foo" ); addedAttr.setTextContent("2"); ValueType value = new ValueType(); value.getContent().add(addedAttr); fragment.setExpression(expression); fragment.setValue(value); request.getAny().add(fragment); client.put(request); resource.destroy(); }
Example 20
Source File: PublishedEndpointUrlTest.java From cxf with Apache License 2.0 | 4 votes |
@Test public void testPublishedEndpointUrl() throws Exception { Greeter implementor = new org.apache.hello_world_soap_http.GreeterImpl(); String publishedEndpointUrl = "http://cxf.apache.org/publishedEndpointUrl"; Bus bus = BusFactory.getDefaultBus(); JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean(); svrFactory.setBus(bus); svrFactory.setServiceClass(Greeter.class); svrFactory.setAddress("http://localhost:" + PORT + "/publishedEndpointUrl"); svrFactory.setPublishedEndpointUrl(publishedEndpointUrl); svrFactory.setServiceBean(implementor); Server server = svrFactory.create(); WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader(); wsdlReader.setFeature("javax.wsdl.verbose", false); URL url = new URL(svrFactory.getAddress() + "?wsdl=1"); HttpURLConnection connect = (HttpURLConnection)url.openConnection(); assertEquals(500, connect.getResponseCode()); Definition wsdl = wsdlReader.readWSDL(svrFactory.getAddress() + "?wsdl"); assertNotNull(wsdl); Collection<Service> services = CastUtils.cast(wsdl.getAllServices().values()); final String failMesg = "WSDL provided incorrect soap:address location"; for (Service service : services) { Collection<Port> ports = CastUtils.cast(service.getPorts().values()); for (Port port : ports) { List<?> extensions = port.getExtensibilityElements(); for (Object extension : extensions) { String actualUrl = null; if (extension instanceof SOAP12Address) { actualUrl = ((SOAP12Address)extension).getLocationURI(); } else if (extension instanceof SOAPAddress) { actualUrl = ((SOAPAddress)extension).getLocationURI(); } //System.out.println("Checking url: " + actualUrl + " against " + publishedEndpointUrl); assertEquals(failMesg, publishedEndpointUrl, actualUrl); } } } server.stop(); server.destroy(); bus.shutdown(true); }