当前位置: 首页>>代码示例>>Java>>正文


Java SoapMessage.put方法代码示例

本文整理汇总了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();
	}

}
 
开发者ID:beemsoft,项目名称:techytax-zk,代码行数:18,代码来源:PolicyControlOutInterceptor.java

示例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);
	}
}
 
开发者ID:mprins,项目名称:muleebmsadapter,代码行数:18,代码来源:OracleEbMSXMLPrefixFixingOutInterceptor.java

示例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);
	}
}
 
开发者ID:mprins,项目名称:muleebmsadapter,代码行数:18,代码来源:XMLSecSignatureOutInterceptor.java

示例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);
	}
}
 
开发者ID:mprins,项目名称:muleebmsadapter,代码行数:18,代码来源:EbMSSecSignatureOutInterceptor.java

示例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);
	}
}
 
开发者ID:mprins,项目名称:muleebmsadapter,代码行数:18,代码来源:XMLDSignatureOutInterceptor.java

示例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);
	}
}
 
开发者ID:mprins,项目名称:muleebmsadapter,代码行数:18,代码来源:LoggingOutInterceptor.java

示例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);
}
 
开发者ID:bhits,项目名称:common-libraries,代码行数:33,代码来源:ContentTypeRebuildingOutboundSoapInterceptor.java

示例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();
      }
   }
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:29,代码来源:SubjectCreatingInterceptor.java

示例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));
      }
   }

}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:36,代码来源:JaspiServerAuthenticator.java

示例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);
}
 
开发者ID:OpenNMS,项目名称:wsman,代码行数:13,代码来源:WSManHeaderInterceptor.java

示例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);
    }
}
 
开发者ID:salesforce-marketingcloud,项目名称:FuelSDK-Java,代码行数:18,代码来源:ClearAttachmentsOutInterceptor.java

示例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);        
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:WriteXmlDeclarationInterceptor.java

示例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);      
}
 
开发者ID:apache,项目名称:juddi,代码行数:5,代码来源:XMLDeclarationWritingInterceptor.java


注:本文中的org.apache.cxf.binding.soap.SoapMessage.put方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。