@NotNull final WSEndpointDescriptor wsEndpointDescriptor) throws Exception {
Adapter adapter;
if (wsEndpointDescriptor.isEJB()) {
final EjbRuntimeEndpointInfo ejbEndPtInfo = (EjbRuntimeEndpointInfo) WebServiceEjbEndpointRegistry.getRegistry().
getEjbWebServiceEndpoint(wsEndpointDescriptor.getURI(), "POST", null);
adapter = (Adapter) ejbEndPtInfo.prepareInvocation(true);
} else {
final String uri = wsEndpointDescriptor.getURI();
adapter = JAXWSAdapterRegistry.getInstance().getAdapter(wsEndpointDescriptor.getContextRoot(), uri, uri);
}