use of org.apache.callback.CallbackPortType in project cxf by apache.
the class ServerImpl method registerCallback.
public String registerCallback(W3CEndpointReference callback) {
try {
WebServiceFeature[] wfs = new WebServiceFeature[] {};
CallbackPortType port = (CallbackPortType) callback.getPort(CallbackPortType.class, wfs);
System.out.println("Invoking callback object");
String resp = port.serverSayHi(System.getProperty("user.name"));
System.out.println("Response from callback object: " + resp);
} catch (Exception ex) {
ex.printStackTrace();
return null;
}
return "registerCallback called";
}
use of org.apache.callback.CallbackPortType in project cxf by apache.
the class ServerImpl method registerCallback.
public String registerCallback(W3CEndpointReference w3cRef) {
try {
WSDLManager manager = new WSDLManagerImpl();
EndpointReferenceType callback = ProviderImpl.convertToInternal(w3cRef);
QName interfaceName = EndpointReferenceUtils.getInterfaceName(callback, bus);
QName serviceName = EndpointReferenceUtils.getServiceName(callback, bus);
String address = EndpointReferenceUtils.getAddress(callback);
String portString = EndpointReferenceUtils.getPortName(callback);
QName portName = new QName(serviceName.getNamespaceURI(), portString);
StringBuilder seiName = new StringBuilder();
seiName.append(JAXBUtils.namespaceURIToPackage(interfaceName.getNamespaceURI()));
seiName.append(".");
seiName.append(JAXBUtils.nameToIdentifier(interfaceName.getLocalPart(), JAXBUtils.IdentifierType.INTERFACE));
Class<?> sei = null;
try {
sei = Class.forName(seiName.toString(), true, manager.getClass().getClassLoader());
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
}
Service service = Service.create(null, serviceName);
service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, address);
CallbackPortType port = (CallbackPortType) service.getPort(portName, sei);
port.serverSayHi("Sean");
} catch (Exception ex) {
ex.printStackTrace();
return null;
}
return "registerCallback called";
}
Aggregations