Hi all,

I tried to remove an operation from a service using the following code
snippet. Unfortunately, the removed operation is still running and clients
still can invoke it. What did I do wrong? Did I misunderstand the method's
purpose? Btw, I tested with the latest version of cxf 2.4.1 and added the
code snippet to wsdl_first sample:

-----------------------------------------------------------------
        EndpointImpl ep = (EndpointImpl)Endpoint.publish("
http://localhost:9090/CustomerServicePort";,
                                                         implementor);

        OperationInfo removeOperationInfo = null;

        List<ServiceInfo> serviceInfoList =
ep.getService().getServiceInfos();
        for (ServiceInfo serviceInfo : serviceInfoList) {
            InterfaceInfo interfaceInfo = serviceInfo.getInterface();

            Collection<OperationInfo> operationInfoCollection =
interfaceInfo.getOperations();
            for (OperationInfo operationInfo : operationInfoCollection) {
                System.out.println(operationInfo.getName());

                if (operationInfo.getName().toString().contains("update"))
                    removeOperationInfo = operationInfo;
            }

            if (removeOperationInfo != null) {
                System.out.println("Remove " +
removeOperationInfo.getName());
                interfaceInfo.removeOperation(removeOperationInfo);
            }
        }
-----------------------------------------------------------------

-- 
Best regards,
Tuan.

Reply via email to