title: CXF ClientProxy getClient "not a proxy instance"
body: <p>I'm attempting to use WS-security with my Apache CXF client.  I need to get a hold of the client endpoint so I can add a WSS4J interceptor.  However, when I call <code>ClientProxy.getClient()</code> I get an <code>IllegalArgumentException</code> with the following message:</p>
  
  <blockquote>
    <p>not a proxy instance</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>MailingService_ServiceLocator serviceLocator = new MailingService_ServiceLocator();
  MailingService_PortType port = serviceLocator.getMailingServicePort();
  
  Client client = ClientProxy.getClient(port);  // throws exception
  
  ...
  
  // Create client interceptor
  AuthenticationInterceptor authenticationInterceptor =
    new AuthenticationInterceptor(schemaNS, outprops, organizationName, null);
  
  client.getEndpoint().getOutInterceptors().add(authenticationInterceptor);
  </code></pre>
  
  <p>Trace:</p>
  
  <pre><code>java.lang.IllegalArgumentException: not a proxy instance
      at java.lang.reflect.Proxy.getInvocationHandler(Unknown Source)
      at org.apache.cxf.frontend.ClientProxy.getClient(ClientProxy.java:93)
  </code></pre>