/** * Tests the published wsdl for EPR extensions * * @throws Exception */ public void testEprInPublishedWSDL() throws Exception { HelloService service = new HelloService(); Hello hello = service.getHelloPort(); WSDLPort wsdlModel = ((WSBindingProvider) hello).getPortInfo().getPort(); WSEndpointReference wsdlepr = wsdlModel.getExtension(WSEndpointReference.class); assertTrue(wsdlepr.getEPRExtensions().size() == 2); WSEndpointReference.EPRExtension idExtn = wsdlepr.getEPRExtension(new QName("http://example.com/addressingidentity", "Identity")); assertTrue( idExtn != null && idExtn .getQName() .equals(new QName("http://example.com/addressingidentity", "Identity"))); }
public void test1() throws Exception { URL fileurl = getResource("hello_literal_identity.wsdl"); WSDLModel doc = RuntimeWSDLParser.parse( fileurl, new StreamSource(fileurl.toExternalForm()), getResolver(), true, null); WSDLService service = doc.getService(new QName("urn:test", "Hello")); WSDLPort port = service.getFirstPort(); WSEndpointReference wsepr = port.getExtension(WSEndpointReference.class); QName q = new QName("http://schemas.xmlsoap.org/ws/2006/02/addressingidentity", "Identity"); WSEndpointReference.EPRExtension eprExtn = wsepr.getEPRExtension(q); XMLStreamReader xsr = eprExtn.readAsXMLStreamReader(); if (xsr.getEventType() == XMLStreamConstants.START_DOCUMENT) xsr.next(); assertEquals(q.getNamespaceURI(), xsr.getNamespaceURI()); assertEquals(q.getLocalPart(), xsr.getLocalName()); }