use of org.apache.callback.SOAPService in project cxf by apache.
the class CallbackClientServerTest method testCallback.
@Test
public void testCallback() throws Exception {
Object implementor = new CallbackImpl();
String address = "http://localhost:" + CB_PORT + "/CallbackContext/CallbackPort";
Endpoint ep = Endpoint.publish(address, implementor);
URL wsdlURL = getClass().getResource("/wsdl/basic_callback_test.wsdl");
SOAPService ss = new SOAPService(wsdlURL, SERVICE_NAME);
ServerPortType port = ss.getPort(PORT_NAME, ServerPortType.class);
updateAddressPort(port, PORT);
EndpointReference w3cEpr = ep.getEndpointReference();
String resp = port.registerCallback((W3CEndpointReference) w3cEpr);
assertEquals("registerCallback called", resp);
ep.stop();
}
use of org.apache.callback.SOAPService in project cxf by apache.
the class Client method main.
public static void main(String[] args) throws Exception {
Object implementor = new CallbackImpl();
String address = "http://localhost:9005/CallbackContext/CallbackPort";
Endpoint endpoint = Endpoint.publish(address, implementor);
if (args.length == 0) {
System.out.println("please specify wsdl");
System.exit(1);
}
URL wsdlURL;
File wsdlFile = new File(args[0]);
if (wsdlFile.exists()) {
wsdlURL = wsdlFile.toURI().toURL();
} else {
wsdlURL = new URL(args[0]);
}
SOAPService ss = new SOAPService(wsdlURL, SERVICE_NAME);
ServerPortType port = ss.getSOAPPort();
InputStream is = demo.callback.client.Client.class.getResourceAsStream("/callback_infoset.xml");
Document doc = StaxUtils.read(is);
Element referenceParameters = DOMUtils.findChildWithAtt(doc.getDocumentElement(), "wsa:ReferenceParameters", "name", "");
W3CEndpointReference ref = (W3CEndpointReference) endpoint.getEndpointReference(referenceParameters);
String resp = port.registerCallback(ref);
System.out.println("Response from server: " + resp);
System.exit(0);
}
Aggregations