use of javax.xml.ws.wsaddressing.W3CEndpointReference in project cxf by apache.
the class DispatchClientServerTest method testCreateDispatchWithEPR.
@Test
public void testCreateDispatchWithEPR() throws Exception {
URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
assertNotNull(wsdl);
SOAPService service = new SOAPService(wsdl, SERVICE_NAME);
assertNotNull(service);
W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
builder.address("http://localhost:" + greeterPort + "/SOAPDispatchService/SoapDispatchPort");
builder.serviceName(SERVICE_NAME);
builder.endpointName(PORT_NAME);
W3CEndpointReference w3cEpr = builder.build();
Dispatch<SOAPMessage> disp = service.createDispatch(w3cEpr, SOAPMessage.class, Service.Mode.MESSAGE);
InputStream is = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml");
SOAPMessage soapReqMsg = MessageFactory.newInstance().createMessage(null, is);
assertNotNull(soapReqMsg);
SOAPMessage soapResMsg = disp.invoke(soapReqMsg);
assertNotNull(soapResMsg);
String expected = "Hello TestSOAPInputMessage";
assertEquals("Response should be : Hello TestSOAPInputMessage", expected, DOMUtils.getAllContent(SAAJUtils.getBody(soapResMsg)).trim());
}
use of javax.xml.ws.wsaddressing.W3CEndpointReference in project cxf by apache.
the class BankImpl method createAccountReference.
private W3CEndpointReference createAccountReference(String accountName) {
String corbaAddress = "corbaname::localhost:1050#" + accountName;
Object account = new AccountImpl();
Endpoint ep = Endpoint.publish(corbaAddress, account);
endpointList.put(accountName, ep);
return (W3CEndpointReference) ep.getEndpointReference((org.w3c.dom.Element[]) null);
}
Aggregations