use of org.apache.cxf.wsdl11.WSDLManagerImpl 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