本文整理汇总了Java中org.apache.cxf.binding.soap.SoapMessage.put方法的典型用法代码示例。如果您正苦于以下问题:Java SoapMessage.put方法的具体用法?Java SoapMessage.put怎么用?Java SoapMessage.put使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cxf.binding.soap.SoapMessage
的用法示例。
在下文中一共展示了SoapMessage.put方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleMessage
import org.apache.cxf.binding.soap.SoapMessage; //导入方法依赖的package包/类
public void handleMessage(SoapMessage message) {
try {
// 1. Build effective policy for response
org.apache.cxf.ws.policy.PolicyBuilder builder = message
.getExchange().getBus()
.getExtension(org.apache.cxf.ws.policy.PolicyBuilder.class);
InputStream xmlGenericPolicy = new FileInputStream("/home/hans/workspace/TechyTax/src/org/techytax/xbrl/policy.xml");
Policy effectivePolicy = builder.getPolicy(xmlGenericPolicy);
// 2. Apply effective policy
message.put(PolicyConstants.POLICY_OVERRIDE, effectivePolicy);
} catch (Exception e) {
e.printStackTrace();
}
}
示例2: handleMessage
import org.apache.cxf.binding.soap.SoapMessage; //导入方法依赖的package包/类
@Override
public void handleMessage(SoapMessage message) throws Fault
{
try
{
OutputStream originalOs = message.getContent(OutputStream.class);
message.put(OUTPUT_STREAM_HOLDER,originalOs);
CachedOutputStream cos = new CachedOutputStream();
message.setContent(OutputStream.class,cos);
message.setContent(XMLStreamWriter.class,StaxOutInterceptor.getXMLOutputFactory(message).createXMLStreamWriter(cos,getEncoding(message)));
message.getInterceptorChain().add(new OracleEbMSXMLPrefixFixingOutEndingInterceptor());
}
catch (Exception e)
{
throw new Fault(e);
}
}
示例3: handleMessage
import org.apache.cxf.binding.soap.SoapMessage; //导入方法依赖的package包/类
@Override
public void handleMessage(SoapMessage message) throws Fault
{
try
{
OutputStream originalOs = message.getContent(OutputStream.class);
message.put(OUTPUT_STREAM_HOLDER,originalOs);
CachedOutputStream cos = new CachedOutputStream();
message.setContent(OutputStream.class,cos);
message.setContent(XMLStreamWriter.class,StaxOutInterceptor.getXMLOutputFactory(message).createXMLStreamWriter(cos,getEncoding(message)));
message.getInterceptorChain().add(new XMLSecSignatureOutEndingInterceptor());
}
catch (XMLStreamException e)
{
throw new Fault(e);
}
}
示例4: handleMessage
import org.apache.cxf.binding.soap.SoapMessage; //导入方法依赖的package包/类
@Override
public void handleMessage(SoapMessage message) throws Fault
{
try
{
OutputStream originalOs = message.getContent(OutputStream.class);
message.put(OUTPUT_STREAM_HOLDER,originalOs);
CachedOutputStream cos = new CachedOutputStream();
message.setContent(OutputStream.class,cos);
message.setContent(XMLStreamWriter.class,StaxOutInterceptor.getXMLOutputFactory(message).createXMLStreamWriter(cos,getEncoding(message)));
message.getInterceptorChain().add(getEndingInterceptor());
}
catch (XMLStreamException e)
{
throw new Fault(e);
}
}
示例5: handleMessage
import org.apache.cxf.binding.soap.SoapMessage; //导入方法依赖的package包/类
@Override
public void handleMessage(SoapMessage message) throws Fault
{
try
{
OutputStream originalOs = message.getContent(OutputStream.class);
message.put(OUTPUT_STREAM_HOLDER,originalOs);
CachedOutputStream cos = new CachedOutputStream();
message.setContent(OutputStream.class,cos);
message.setContent(XMLStreamWriter.class,StaxOutInterceptor.getXMLOutputFactory(message).createXMLStreamWriter(cos,getEncoding(message)));
message.getInterceptorChain().add(new XMLDSignatureOutEndingInterceptor());
}
catch (XMLStreamException e)
{
throw new Fault(e);
}
}
示例6: handleMessage
import org.apache.cxf.binding.soap.SoapMessage; //导入方法依赖的package包/类
@Override
public void handleMessage(SoapMessage message) throws Fault
{
try
{
OutputStream originalOs = message.getContent(OutputStream.class);
message.put(OUTPUT_STREAM_HOLDER,originalOs);
CachedOutputStream cos = new CachedOutputStream();
message.setContent(OutputStream.class,cos);
message.setContent(XMLStreamWriter.class,StaxOutInterceptor.getXMLOutputFactory(message).createXMLStreamWriter(cos,getEncoding(message)));
message.getInterceptorChain().add(new LoggingOutEndingInterceptor());
}
catch (XMLStreamException e)
{
throw new Fault(e);
}
}
示例7: handleMessage
import org.apache.cxf.binding.soap.SoapMessage; //导入方法依赖的package包/类
@Override
public void handleMessage(SoapMessage message) throws Fault {
debug(() -> message.toString());
debug(() -> new StringBuilder().append(CONTENT_TYPE)
.append(" before modification: ")
.append(message.get(CONTENT_TYPE).toString()).toString());
final String contentType = (String) message.get(CONTENT_TYPE);
final List<Pair> contentTypeList = new ArrayList<>();
try (Scanner scanner = new Scanner(contentType)) {
scanner.useDelimiter(SEMICOLON);
while (scanner.hasNext()) {
final String next = scanner.next();
final String[] split = next.split(EQUAL);
contentTypeList.add(new Pair(clean(split, IDX_KEY),
split.length > IDX_VALUE ? Optional.of(clean(split,
IDX_VALUE)) : Optional.empty()));
}
}
final String correctedContentType = contentTypeList
.stream()
.map(ContentTypeRebuildingOutboundSoapInterceptor::toCorrectedContentType)
.collect(joining(SEMICOLON_WITH_SPACE));
debug(() -> new StringBuilder().append(CONTENT_TYPE)
.append(" after modification: ").append(correctedContentType)
.toString());
message.put(CONTENT_TYPE, correctedContentType);
}
示例8: handleMessage
import org.apache.cxf.binding.soap.SoapMessage; //导入方法依赖的package包/类
@Override
public void handleMessage(SoapMessage msg) throws Fault {
Endpoint ep = msg.getExchange().get(Endpoint.class);
sdc.set(ep.getSecurityDomainContext());
try
{
SecurityToken token = msg.get(SecurityToken.class);
SecurityContext context = msg.get(SecurityContext.class);
if (token == null || context == null || context.getUserPrincipal() == null) {
super.handleMessage(msg);
return;
}
UsernameToken ut = (UsernameToken)token;
Subject subject = createSubject(ut.getName(), ut.getPassword(), ut.isHashed(),
ut.getNonce(), ut.getCreatedTime());
SecurityContext sc = doCreateSecurityContext(context.getUserPrincipal(), subject);
msg.put(SecurityContext.class, sc);
}
finally
{
if (sdc != null)
{
sdc.remove();
}
}
}
示例9: secureResponse
import org.apache.cxf.binding.soap.SoapMessage; //导入方法依赖的package包/类
public void secureResponse(SoapMessage message)
{
SOAPMessage request = message.getExchange().getInMessage().get(SOAPMessage.class);
SOAPMessage response = message.getContent(SOAPMessage.class);
MessageInfo messageInfo = new GenericMessageInfo(request, response);
AuthStatus authStatus = null;
try
{
authStatus = sctx.secureResponse(messageInfo, null);
}
catch (AuthException e)
{
if (isSOAP12(message))
{
SoapFault soap12Fault = new SoapFault(e.getMessage(), Soap12.getInstance().getReceiver());
throw soap12Fault;
}
else
{
throw new SoapFault(e.getMessage(), new QName("", "jaspi AuthException"));
}
}
if (messageInfo.getResponseMessage() != null && !message.getExchange().isOneWay())
{
if (AuthStatus.SEND_CONTINUE == authStatus)
{
message.put(Message.RESPONSE_CODE, Integer.valueOf(303));
}
if (AuthStatus.SEND_FAILURE == authStatus)
{
message.put(Message.RESPONSE_CODE, Integer.valueOf(500));
}
}
}
示例10: handleMessage
import org.apache.cxf.binding.soap.SoapMessage; //导入方法依赖的package包/类
@Override
public void handleMessage(SoapMessage message) throws Fault {
// Retrieve the current list of headers
List<Header> headers = message.getHeaders();
// Always add the resourceUri header
headers.add(getResourceUriHeader());
// Add the selectorSet header iff have one or more selectors
if (!m_selectors.isEmpty()) {
headers.add(getSelectorSetHeader());
}
message.put(Header.HEADER_LIST, headers);
}
示例11: handleMessage
import org.apache.cxf.binding.soap.SoapMessage; //导入方法依赖的package包/类
/**
* @param message The SOAP message to handle.
*/
public void handleMessage(SoapMessage message) throws Fault {
message.getExchange()
.getOutMessage()
.setContent(org.apache.cxf.attachment.AttachmentSerializer.class, null);
Map<String, List> headers = new HashMap<String, List>();
try {
headers.put("User-Agent", Collections.singletonList(message.get("HTTP_HEADER_USER_AGENT")));
message.put(Message.PROTOCOL_HEADERS, headers);
} catch (Exception ce) {
throw new Fault(ce);
}
}
示例12: handleMessage
import org.apache.cxf.binding.soap.SoapMessage; //导入方法依赖的package包/类
public void handleMessage(SoapMessage message) throws Fault {
message.put("org.apache.cxf.stax.force-start-document", Boolean.TRUE);
}
示例13: handleMessage
import org.apache.cxf.binding.soap.SoapMessage; //导入方法依赖的package包/类
@Override
public void handleMessage(SoapMessage message) throws Fault {
message.put("org.apache.cxf.stax.force-start-document", Boolean.TRUE);
}