本文整理了Java中org.apache.cxf.endpoint.Client.getRequestContext()
方法的一些代码示例,展示了Client.getRequestContext()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Client.getRequestContext()
方法的具体详情如下:
包路径:org.apache.cxf.endpoint.Client
类名称:Client
方法名:getRequestContext
[英]Gets the request context used for future invocations
[中]获取用于将来调用的请求上下文
代码示例来源:origin: stackoverflow.com
Client client = ClientProxy.getClient(port);
client.getRequestContext().put(Message.ENDPOINT_ADDRESS, "http://some-valid-endpoint") ;
代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws
public Map<String, Object> getRequestContext() {
return new WrappedMessageContext(client.getRequestContext(),
null,
Scope.APPLICATION);
}
public Map<String, Object> getResponseContext() {
代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws
public Map<String, Object> getRequestContext() {
if (client == null) {
throw new IllegalStateException("The client has been closed.");
}
return new WrappedMessageContext(this.getClient().getRequestContext(),
null,
Scope.APPLICATION);
}
public Map<String, Object> getResponseContext() {
代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws
private void setupEndpointAddressContext(Endpoint endpoint) {
//NOTE for jms transport the address would be null
if (null != endpoint
&& null != endpoint.getEndpointInfo().getAddress()) {
Map<String, Object> requestContext
= new WrappedMessageContext(client.getRequestContext(),
null,
Scope.APPLICATION);
requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
endpoint.getEndpointInfo().getAddress());
}
}
public T invoke(T obj) {
代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws
client.getRequestContext().put(Method.class.getName(), method);
boolean isAsync = isAsync(method);
代码示例来源:origin: apache/cxf
@Override
public Map<String, Object> getRequestContext() {
return Client.this.getRequestContext();
}
@Override
代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws
SOAPMessage msg = (SOAPMessage)obj;
if (msg.countAttachments() > 0) {
client.getRequestContext().put(AttachmentOutInterceptor.WRITE_ATTACHMENTS, Boolean.TRUE);
代码示例来源:origin: org.apache.cxf/cxf-core
@Override
public Map<String, Object> getRequestContext() {
return Client.this.getRequestContext();
}
@Override
代码示例来源:origin: apache/cxf
public Map<String, Object> getRequestContext() {
if (client == null) {
throw new IllegalStateException("The client has been closed.");
}
return client.getRequestContext();
}
public Map<String, Object> getResponseContext() {
代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-simple
public Map<String, Object> getRequestContext() {
if (client == null) {
throw new IllegalStateException("The client has been closed.");
}
return client.getRequestContext();
}
public Map<String, Object> getResponseContext() {
代码示例来源:origin: stackoverflow.com
Client proxy = ClientProxy.getClient(stub);
// Creating HTTP headers
Map<String, List<String>> headers = new HashMap<String, List<String>>();
headers.put("Authorization", Arrays.asList("Basic pass"));
// Add HTTP headers to the web service request
proxy.getRequestContext().put(Message.PROTOCOL_HEADERS, headers);
代码示例来源:origin: stackoverflow.com
Map<String, String> nsMap = new HashMap<>();
nsMap.put("prefix1", "url1");
nsMap.put("prefix2", "url2");
nsMap.put("prefix3", "url3");
nsMap.put("prefix4", "url4");
nsMap.put("prefix5", "http://www.w3.org/2001/04/xmlenc#");
Client client = ClientProxy.getClient(port);
client.getRequestContext().put("soap.env.ns.map", nsMap);
代码示例来源:origin: apache/cxf
public Map<String, Object> getRequestContext() {
return new WrappedMessageContext(client.getRequestContext(),
null,
Scope.APPLICATION);
}
public Map<String, Object> getResponseContext() {
代码示例来源:origin: org.mule.modules/mule-module-cxf
protected void cleanup()
{
// MULE-4899: cleans up client's request and response context to avoid a
// memory leak.
Map<String, Object> requestContext = client.getRequestContext();
requestContext.clear();
Map<String, Object> responseContext = client.getResponseContext();
responseContext.clear();
}
代码示例来源:origin: stackoverflow.com
Client proxy = ClientProxy.getClient(yourClient);
List<Header> headersList = new ArrayList<Header>();
Header header = new Header(new QName("uri:my.uri", "mysoapheader"), "Header Content", new JAXBDataBinding(String.class));
headersList.add(header);
proxy.getRequestContext().put(Header.HEADER_LIST, headersList);
代码示例来源:origin: io.oasp.java.modules/oasp4j-cxf-client-ws
@Override
protected void applyHeaders(ServiceContext<?> context, Object client) {
Collection<String> headerNames = context.getHeaderNames();
if (!headerNames.isEmpty()) {
Map<String, List<String>> headers = new HashMap<>();
for (String headerName : headerNames) {
headers.put(headerName, Arrays.asList(context.getHeader(headerName)));
}
((Client) client).getRequestContext().put(Message.PROTOCOL_HEADERS, headers);
}
}
代码示例来源:origin: oasp/oasp4j
@Override
protected void applyHeaders(ServiceContext<?> context, Object client) {
Collection<String> headerNames = context.getHeaderNames();
if (!headerNames.isEmpty()) {
Map<String, List<String>> headers = new HashMap<>();
for (String headerName : headerNames) {
headers.put(headerName, Arrays.asList(context.getHeader(headerName)));
}
((Client) client).getRequestContext().put(Message.PROTOCOL_HEADERS, headers);
}
}
代码示例来源:origin: apache/cxf
public Map<String, Object> getRequestContext() {
if (client == null) {
throw new IllegalStateException("The client has been closed.");
}
return new WrappedMessageContext(this.getClient().getRequestContext(),
null,
Scope.APPLICATION);
}
public Map<String, Object> getResponseContext() {
代码示例来源:origin: stackoverflow.com
JAXRSClientFactoryBean factoryBean = new JAXRSClientFactoryBean();
factoryBean.setAddress("http://localhost:6061/services");
MyServiceInterface documentCapture = factoryBean.create(MyServiceInterface.class);
Client client = ClientProxy.getClient(documentCapture);
client.getRequestContext().put("use.async.http.conduit", Boolean.TRUE);
代码示例来源:origin: apache/cxf
private void setupEndpointAddressContext(Endpoint endpoint) {
//NOTE for jms transport the address would be null
if (null != endpoint
&& null != endpoint.getEndpointInfo().getAddress()) {
Map<String, Object> requestContext
= new WrappedMessageContext(client.getRequestContext(),
null,
Scope.APPLICATION);
requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
endpoint.getEndpointInfo().getAddress());
}
}
public T invoke(T obj) {
内容来源于网络,如有侵权,请联系作者删除!