use of javax.xml.ws.wsaddressing.W3CEndpointReference in project cxf by apache.
the class WSNHelper method getPort.
public <T> T getPort(EndpointReference ref, Class<T> serviceInterface, Class<?>... extraClasses) {
if (!(ref instanceof W3CEndpointReference)) {
throw new IllegalArgumentException("Unsupported endpoint reference: " + (ref != null ? ref.toString() : "null"));
}
W3CEndpointReference w3cEpr = (W3CEndpointReference) ref;
String address = getWSAAddress(w3cEpr);
return getPort(address, serviceInterface, extraClasses);
}
use of javax.xml.ws.wsaddressing.W3CEndpointReference in project cxf by apache.
the class LocatorClientServerTest method testLookupEndpointAndVerifyWsdlLocationOnly.
@Test
public void testLookupEndpointAndVerifyWsdlLocationOnly() throws Exception {
URL wsdl = getClass().getResource("/wsdl/locator.wsdl");
assertNotNull(wsdl);
LocatorService_Service ss = new LocatorService_Service(wsdl, serviceName);
LocatorService port = ss.getLocatorServicePort();
updateAddressPort(port, PORT);
W3CEndpointReference epr = port.lookupEndpoint(new QName("http://service/2", "Number"));
String eprString = epr.toString();
assertTrue(eprString.contains("Metadata"));
assertTrue(eprString.contains("wsdlLocation=\"wsdlLoc\""));
}
use of javax.xml.ws.wsaddressing.W3CEndpointReference in project cxf by apache.
the class LocatorClientServerTest method testLookupEndpointAndVerifyWsdlLocationAndNamespace.
@Test
public void testLookupEndpointAndVerifyWsdlLocationAndNamespace() throws Exception {
URL wsdl = getClass().getResource("/wsdl/locator.wsdl");
assertNotNull(wsdl);
LocatorService_Service ss = new LocatorService_Service(wsdl, serviceName);
LocatorService port = ss.getLocatorServicePort();
updateAddressPort(port, PORT);
W3CEndpointReference epr = port.lookupEndpoint(new QName("http://service/1", "Number"));
String eprString = epr.toString();
assertTrue(eprString.contains("Metadata"));
assertTrue(eprString.contains("wsdlLocation=\"http://service/1 wsdlLoc\""));
}
use of javax.xml.ws.wsaddressing.W3CEndpointReference in project cxf by apache.
the class EndpointReferenceTest method testProviderReadEndpointReference.
@Test
public void testProviderReadEndpointReference() throws Exception {
ProviderImpl provider = new ProviderImpl();
InputStream is = getClass().getResourceAsStream("resources/hello_world_soap_http_infoset.xml");
Document doc = StaxUtils.read(is);
DOMSource erXML = new DOMSource(doc);
EndpointReference endpointReference = provider.readEndpointReference(erXML);
assertNotNull(endpointReference);
assertTrue(endpointReference instanceof W3CEndpointReference);
}
use of javax.xml.ws.wsaddressing.W3CEndpointReference in project cxf by apache.
the class EndpointReferenceTest method testBindingProviderSOAPBinding.
@Test
public void testBindingProviderSOAPBinding() throws Exception {
javax.xml.ws.Service s = javax.xml.ws.Service.create(new QName("http://apache.org/hello_world_soap_http", "SoapPort"));
assertNotNull(s);
Greeter greeter = s.getPort(Greeter.class);
BindingProvider bindingProvider = (BindingProvider) greeter;
EndpointReference er = bindingProvider.getEndpointReference();
assertNotNull(er);
// If the BindingProvider instance has a binding that is either SOAP 1.1/HTTP or SOAP
// 1.2/HTTP, then a W3CEndpointReference MUST be returned.
assertTrue(er instanceof W3CEndpointReference);
}
Aggregations