If you want to add an interceptor on the client side, you can do something like:
Service service = Service.create(wsdlLocation, serviceQName); PortType port = service.getPort(portQName, PortType.class); Client cxfClient = ClientProxy.getClient(port); cxfClient.getOutInterceptors().add(...) Here's an example: https://github.com/apache/cxf/blob/dcae47fac2c0e22994572e6744852070737223e5/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/ut/UsernameTokenTest.java#L439 Colm. On Thu, Feb 1, 2018 at 9:07 PM, George S. <[email protected]> wrote: > I apologize for the really basic level of my question. I've looked at the > docs and I'm really not figuring out how to do this. I'm adapting some code: > > import javax.xml.ws.Service; > > URL wsdlLocation =new URL(WS_URL); > QName serviceQName =new QName(namespace, serviceName); > QName portQName =new QName(namespace, portName); > Service service = Service.create(wsdlLocation, serviceQName); > > and I'm desperately trying to figure out how to get an Endpoint so I can > add an Interceptor. If I have the service ( which from looking at the code > for javax.xml.ws.Service is created by a Provider()), how can I get to the > endpoint? > > I've looked at: > > http://cxf.apache.org/docs/ws-security.html > > and in the section labelled "Adding the interceptors via the API", the > example shows passing in a "myServiceImpl". > > What are the steps to go through for creation of a "myServiceImpl"? What > are class is "myServiceImpl", and how is one obtained? > > Again, I apologize if these questions for the basic nature of my questions. > > > > -- > George S. > *MH Software, Inc.* > Voice: 303 438 9585 > http://www.mhsoftware.com > -- Colm O hEigeartaigh Talend Community Coder http://coders.talend.com
