本文整理了Java中org.apache.cxf.endpoint.Client.getInInterceptors()
方法的一些代码示例,展示了Client.getInInterceptors()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Client.getInInterceptors()
方法的具体详情如下:
包路径:org.apache.cxf.endpoint.Client
类名称:Client
方法名:getInInterceptors
暂无
代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws
private void initIntercepors(Client client, AbstractBasicInterceptorProvider clientFact) {
client.getInInterceptors().addAll(clientFact.getInInterceptors());
client.getOutInterceptors().addAll(clientFact.getOutInterceptors());
client.getInFaultInterceptors().addAll(clientFact.getInFaultInterceptors());
client.getOutFaultInterceptors().addAll(clientFact.getOutFaultInterceptors());
}
代码示例来源:origin: stackoverflow.com
Client client = ClientProxy.getClient(port);
client.getInInterceptors().add(new GZIPInInterceptor());
client.getOutInterceptors().add(new GZIPOutInterceptor());
代码示例来源:origin: apache/cxf
public List<Interceptor<? extends Message>> getInInterceptors() {
if (client != null) {
return client.getInInterceptors();
}
return in;
}
代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws
client.getEndpoint()
.getBinding().getBindingInfo().getName()));
client.getInInterceptors().add(new SAAJInInterceptor());
client.getInInterceptors()
.add(new MessageModeInInterceptor(clazz,
client.getEndpoint()
代码示例来源:origin: todvora/eet-client
/**
* Logs all requests and responses of the WS communication (see log4j2.xml file for exact logging settings)
*/
private void configureLogging(final Client clientProxy) {
clientProxy.getInInterceptors().add(WebserviceLogging.LOGGING_IN_INTERCEPTOR);
clientProxy.getOutInterceptors().add(WebserviceLogging.LOGGING_OUT_INTERCEPTOR);
clientProxy.getOutInterceptors().add(TimingSendInterceptor.INSTANCE);
clientProxy.getInInterceptors().add(TimingReceiveInterceptor.INSTANCE);
}
}
代码示例来源:origin: todvora/eet-client
/**
* Sign our request with the client key par.
*/
private void configureSigning(final Client clientProxy) {
final WSS4JOutInterceptor wssOut = createSigningInterceptor();
clientProxy.getOutInterceptors().add(wssOut);
final WSS4JInInterceptor wssIn = createValidatingInterceptor();
clientProxy.getInInterceptors().add(wssIn);
clientProxy.getInInterceptors().add(new SignatureFaultInterceptor());
}
代码示例来源:origin: org.openehealth.ipf.commons/ipf-commons-ihe-hl7v3
@Override
protected void configureInterceptors(Client client) {
super.configureInterceptors(client);
client.getInInterceptors().add(new InPayloadExtractorInterceptor(SOAP_BODY));
client.getInInterceptors().add(new InNamespaceMergeInterceptor());
client.getInInterceptors().add(new InPayloadInjectorInterceptor(0));
client.getEndpoint().getService().setDataBinding(new PlainXmlDataBinding());
}
}
代码示例来源:origin: org.mule.services/mule-service-soap
private void addSecurityInterceptors(Client client, List<SecurityStrategyCxfAdapter> securityStrategies) {
Map<String, Object> requestProps = buildSecurityProperties(securityStrategies, SecurityStrategyType.OUTGOING);
if (!requestProps.isEmpty()) {
client.getOutInterceptors().add(new WSS4JOutInterceptor(requestProps));
}
Map<String, Object> responseProps = buildSecurityProperties(securityStrategies, SecurityStrategyType.INCOMING);
if (!responseProps.isEmpty()) {
client.getInInterceptors().add(new WSS4JInInterceptor(responseProps));
}
}
代码示例来源:origin: stackoverflow.com
// output log using log4j
//LogUtils.setLoggerClass(org.apache.cxf.common.logging.Log4jLogger.class);
yourService = new YourService(wsdlURL, SERVICE_NAME);
port = yourService.getServicePort();
Client client = ClientProxy.getClient(port);
client.getInInterceptors().add(new LoggingInInterceptor());
client.getOutInterceptors().add(new LoggingOutInterceptor());
代码示例来源:origin: apache/cxf
@Override
public void initialize(Client client, Bus bus) {
createDefaultProvidersIfNeeded(bus);
//can optimize for client case and just put interceptors it needs
MetricsMessageOutInterceptor out = new MetricsMessageOutInterceptor(providers);
CountingOutInterceptor countingOut = new CountingOutInterceptor();
client.getInInterceptors().add(new MetricsMessageInInterceptor(providers));
client.getInInterceptors().add(new MetricsMessageInPostInvokeInterceptor(providers));
client.getInFaultInterceptors().add(new MetricsMessageInPostInvokeInterceptor(providers));
client.getOutInterceptors().add(countingOut);
client.getOutInterceptors().add(out);
client.getOutInterceptors().add(new MetricsMessageClientOutInterceptor(providers));
}
代码示例来源:origin: apache/cxf
private void initIntercepors(Client client, AbstractBasicInterceptorProvider clientFact) {
client.getInInterceptors().addAll(clientFact.getInInterceptors());
client.getOutInterceptors().addAll(clientFact.getOutInterceptors());
client.getInFaultInterceptors().addAll(clientFact.getInFaultInterceptors());
client.getOutFaultInterceptors().addAll(clientFact.getOutFaultInterceptors());
}
代码示例来源:origin: stackoverflow.com
AWSECommerceServicePortType ss = new AWSECommerceService().getAWSECommerceServicePort();
Client client = ClientProxy.getClient(ss);
client.getInInterceptors().add(new LoggingInInterceptor());
client.getOutInterceptors().add(new LoggingOutInterceptor());
代码示例来源:origin: apache/cxf
@Test
public void testArgfiles() throws Exception {
System.setProperty("org.apache.cxf.common.util.Compiler-fork", "true");
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
Client client = dcf.createClient(new URL("http://localhost:"
+ PORT1 + "/ArrayService?wsdl"));
String[] values = new String[] {"foobar", "something" };
List<String> list = Arrays.asList(values);
client.getOutInterceptors().add(new LoggingOutInterceptor());
client.getInInterceptors().add(new LoggingInInterceptor());
client.invoke("init", list);
}
代码示例来源:origin: apache/cxf
@Test
public void testArrayList() throws Exception {
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
Client client = dcf.createClient(new URL("http://localhost:"
+ PORT1 + "/ArrayService?wsdl"));
String[] values = new String[] {"foobar", "something" };
List<String> list = Arrays.asList(values);
client.getOutInterceptors().add(new LoggingOutInterceptor());
client.getInInterceptors().add(new LoggingInInterceptor());
client.invoke("init", list);
}
代码示例来源:origin: apache/cxf
@Before
public void setUp() throws Exception {
URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
greeter = new SOAPService(wsdl, SERVICE_NAME).getPort(Greeter.class);
BindingProvider bp = (BindingProvider)greeter;
ClientProxy.getClient(greeter).getInInterceptors().add(new LoggingInInterceptor());
ClientProxy.getClient(greeter).getOutInterceptors().add(new LoggingOutInterceptor());
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
ADDRESS);
bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "ffang");
bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "pswd");
}
代码示例来源:origin: org.apache.camel/camel-cxf
@Override
public void initialize(Client client, Bus bus) {
//check if there is logging interceptor
removeInterceptorWhichIsOutThePhases(client.getInInterceptors(), REMAINING_IN_PHASES, getInInterceptorNames());
removeInterceptorWhichIsOutThePhases(client.getEndpoint().getInInterceptors(), REMAINING_IN_PHASES, getInInterceptorNames());
client.getEndpoint().getBinding().getInInterceptors().clear();
//we need to keep the LoggingOutputInterceptor
getOutInterceptorNames().add(LoggingOutInterceptor.class.getName());
removeInterceptorWhichIsOutThePhases(client.getOutInterceptors(), REMAINING_OUT_PHASES, getOutInterceptorNames());
removeInterceptorWhichIsOutThePhases(client.getEndpoint().getOutInterceptors(), REMAINING_OUT_PHASES, getOutInterceptorNames());
client.getEndpoint().getBinding().getOutInterceptors().clear();
client.getEndpoint().getOutInterceptors().add(new RawMessageContentRedirectInterceptor());
}
代码示例来源:origin: apache/cxf
@Test
public void testClientInTransformation() {
Service service = Service.create(SERVICE_NAME);
String endpoint = "http://localhost:" + PORT + "/EchoContext/EchoPort";
service.addPort(PORT_NAME, SOAPBinding.SOAP11HTTP_BINDING, endpoint);
Echo port = service.getPort(PORT_NAME, Echo.class);
Client client = ClientProxy.getClient(port);
XSLTInInterceptor inInterceptor = new XSLTInInterceptor(XSLT_RESPONSE_PATH);
client.getInInterceptors().add(inInterceptor);
String response = port.echo("test");
assertTrue(response.contains(TRANSFORMED_CONSTANT));
}
}
代码示例来源:origin: apache/cxf
@Before
public void setUp() throws Exception {
URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
greeter = new SOAPService(wsdl, SERVICE_NAME).getPort(Greeter.class);
BindingProvider bp = (BindingProvider)greeter;
ClientProxy.getClient(greeter).getInInterceptors().add(new LoggingInInterceptor());
ClientProxy.getClient(greeter).getOutInterceptors().add(new LoggingOutInterceptor());
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
ADDRESS);
bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "ffang");
bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "pswd");
}
代码示例来源:origin: apache/cxf
@Test
public void testClientProxyFactory() {
JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean();
cf.setAddress("http://localhost:" + PORT + "/test");
cf.getFeatures().add(new WSAddressingFeature());
cf.setServiceClass(Greeter.class);
Greeter greeter = (Greeter) cf.create();
Client client = ClientProxy.getClient(greeter);
checkAddressInterceptors(client.getInInterceptors());
}
代码示例来源:origin: apache/cxf
@Test
public void testClientProxyFactory() {
JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean();
cf.setAddress("http://localhost:" + PORT + "/test");
cf.setServiceClass(Greeter.class);
cf.setBus(getBus());
Configurer c = getBus().getExtension(Configurer.class);
c.configureBean("client.proxyFactory", cf);
Greeter greeter = (Greeter) cf.create();
Client client = ClientProxy.getClient(greeter);
checkAddressInterceptors(client.getInInterceptors());
}
内容来源于网络,如有侵权,请联系作者删除!