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 HttpNumberFactoryImpl method create.
public W3CEndpointReference create(String id) {
String portName = null;
EndpointReferenceType epr = EndpointReferenceUtils.getEndpointReferenceWithId(NUMBER_SERVICE_QNAME, portName, id, bus);
Source source = EndpointReferenceUtils.convertToXML(epr);
return new W3CEndpointReference(source);
}
use of javax.xml.ws.wsaddressing.W3CEndpointReference in project cxf by apache.
the class ManualHttpMulitplexClientServerTest method testWithManualMultiplexEprCreation.
@Test
public void testWithManualMultiplexEprCreation() throws Exception {
NumberFactoryService service = new NumberFactoryService();
NumberFactory nfact = service.getNumberFactoryPort();
updateAddressPort(nfact, PORT);
W3CEndpointReference w3cEpr = nfact.create("2");
assertNotNull("reference", w3cEpr);
// use the epr info only
// no wsdl so default generated soap/http binding will be used
// address url must come from the calling context
EndpointReferenceType epr = ProviderImpl.convertToInternal(w3cEpr);
QName serviceName = EndpointReferenceUtils.getServiceName(epr, bus);
Service numService = Service.create(serviceName);
String portString = EndpointReferenceUtils.getPortName(epr);
QName portName = new QName(serviceName.getNamespaceURI(), portString);
numService.addPort(portName, SoapBindingFactory.SOAP_11_BINDING, "http://foo");
Number num = numService.getPort(portName, Number.class);
setupContextWithEprAddress(epr, num);
IsEvenResponse numResp = num.isEven();
assertTrue("2 is even", Boolean.TRUE.equals(numResp.isEven()));
// try again with the address from another epr
w3cEpr = nfact.create("3");
epr = ProviderImpl.convertToInternal(w3cEpr);
setupContextWithEprAddress(epr, num);
numResp = num.isEven();
assertTrue("3 is not even", Boolean.FALSE.equals(numResp.isEven()));
// try again with the address from another epr
w3cEpr = nfact.create("6");
epr = ProviderImpl.convertToInternal(w3cEpr);
setupContextWithEprAddress(epr, num);
numResp = num.isEven();
assertTrue("6 is even", Boolean.TRUE.equals(numResp.isEven()));
}
use of javax.xml.ws.wsaddressing.W3CEndpointReference in project cxf by apache.
the class ManualNumberFactoryImpl method create.
public W3CEndpointReference create(String id) {
manageNumberServantInitialisation();
// manually force id into address context as context appendage
EndpointReferenceType epr = EndpointReferenceUtils.duplicate(templateEpr);
EndpointReferenceUtils.setAddress(epr, EndpointReferenceUtils.getAddress(epr) + id);
Source source = EndpointReferenceUtils.convertToXML(epr);
return new W3CEndpointReference(source);
}
Aggregations