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


Java SoapMessage.getHeaders方法代码示例

本文整理汇总了Java中org.apache.cxf.binding.soap.SoapMessage.getHeaders方法的典型用法代码示例。如果您正苦于以下问题:Java SoapMessage.getHeaders方法的具体用法?Java SoapMessage.getHeaders怎么用?Java SoapMessage.getHeaders使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cxf.binding.soap.SoapMessage的用法示例。


在下文中一共展示了SoapMessage.getHeaders方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleMessage

import org.apache.cxf.binding.soap.SoapMessage; //导入方法依赖的package包/类
public void handleMessage(SoapMessage message) throws Fault {
	Document doc = DOMUtils.createDocument();
	
	Element SYSTEM_ID = doc.createElementNS(NAMESPACE_URI, ELEMENT_SYSTEM_ID);
	SYSTEM_ID.setTextContent(systemId);
	
	Element SYSTEM_PW = doc.createElementNS(NAMESPACE_URI, ELEMENT_SYSTEM_PW);
	SYSTEM_PW.setTextContent(systemPw);

	Element token = doc.createElementNS(NAMESPACE_URI, ELEMENT_TOKEN);
	token.appendChild(SYSTEM_ID);
	token.appendChild(SYSTEM_PW);		
	
	SoapHeader header = new SoapHeader(new QName(NAMESPACE_URI), token); 
       List<Header> headers = message.getHeaders();  
       headers.add(header); 
}
 
开发者ID:brightzheng100,项目名称:learning-spring-cxf,代码行数:18,代码来源:SystemTokenClientInterceptor.java

示例2: addRequestingCaisiProviderNo

import org.apache.cxf.binding.soap.SoapMessage; //导入方法依赖的package包/类
private static void addRequestingCaisiProviderNo(SoapMessage message, String providerNo) {
	List<Header> headers = message.getHeaders();

	if (providerNo != null) {
		headers.add(createHeader(REQUESTING_CAISI_PROVIDER_NO_QNAME, REQUESTING_CAISI_PROVIDER_NO_KEY, providerNo));
	}
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:8,代码来源:AuthenticationOutWSS4JInterceptorForIntegrator.java

示例3: handleMessage

import org.apache.cxf.binding.soap.SoapMessage; //导入方法依赖的package包/类
@Override
public void handleMessage(Message message) throws Fault
{
   ServletRequest req = (ServletRequest) message.get(AbstractHTTPDestination.HTTP_REQUEST);
   if (req != null && "true".equals(req.getAttribute("org.wildfly.suspended")))
   {
      if (message instanceof SoapMessage)
      {
         SoapMessage soapMessage = (SoapMessage)message;
         if (!soapMessage.hasHeaders())
         {
            throw createFault();
         }
         else
         {
            Deployment dep = soapMessage.getExchange().get(Endpoint.class).getService().getDeployment();
            RejectionRule rr = dep.getAttachment(RejectionRule.class);
            if (rr != null)
            {
               List<Header> headers = soapMessage.getHeaders();
               Map<QName, Object> m = new HashMap<>();
               for (Header header : headers)
               {
                  m.put(header.getName(), header.getObject());
               }
               if (rr.rejectMessage(m))
               {
                  throw createFault();
               }
            }
         }
      }
      else
      {
         throw createFault();
      }
   }
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:39,代码来源:GracefulShutdownInterceptor.java

示例4: 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

示例5: handleMessage

import org.apache.cxf.binding.soap.SoapMessage; //导入方法依赖的package包/类
public void handleMessage(SoapMessage message) throws Fault {
	List<Header> headers = message.getHeaders();
    
    if(headers==null){
    	throw new Fault(new SOAPException("Request must include authentication token.")); 
    }
    
    boolean foundToken = false;
    String systemId = "";
    String systemPw = "";
    for (Header header : headers) {
    	Element element = (Element) header.getObject();
    	
    	if(ELEMENT_TOKEN.equalsIgnoreCase(element.getNodeName())
    			&& NAMESPACE_URI.equalsIgnoreCase(element.getNamespaceURI())){
    		//found
    		foundToken = true;
    		
    		//SYSTEM_ID
    		Node systemIdNode = element.getFirstChild();
    		systemId = systemIdNode.getTextContent();
    		
    		//SYSTEM_PW
    		Node systemPwNode = element.getLastChild();
    		systemPw = systemPwNode.getTextContent();
    		
    		break;
    	}else{
    		//continue finding
    		continue;
    	}
    }
    
    if(!foundToken){
    	throw new Fault(new SOAPException("Request must include authentication token: " + ELEMENT_TOKEN)); 
    }else{
    	System.out.println("==>Received " + ELEMENT_SYSTEM_ID + "=" + systemId);
    	System.out.println("==>Received " + ELEMENT_SYSTEM_PW + "=" + systemPw);
    }
}
 
开发者ID:brightzheng100,项目名称:learning-spring-cxf,代码行数:41,代码来源:SystemTokenServerInterceptor.java

示例6: addRequestionCaisiProviderNo

import org.apache.cxf.binding.soap.SoapMessage; //导入方法依赖的package包/类
private static void addRequestionCaisiProviderNo(SoapMessage message) {
	List<Header> headers = message.getHeaders();

	LoggedInInfo loggedInInfo = LoggedInInfo.loggedInInfo.get();
	if (loggedInInfo.loggedInProvider != null) {
		headers.add(createHeader(REQUESTING_CAISI_PROVIDER_NO_QNAME, REQUESTING_CAISI_PROVIDER_NO_KEY, loggedInInfo.loggedInProvider.getProviderNo()));
	}
}
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:9,代码来源:AuthenticationOutWSS4JInterceptorForIntegrator.java

示例7: handleMessage

import org.apache.cxf.binding.soap.SoapMessage; //导入方法依赖的package包/类
@Override
public void handleMessage(SoapMessage message)
    throws Fault
{
    ClientProviderBean bean = FMOutHeaderHolder.get();
    List<Header> headerList=message.getHeaders();
    
    String iDCAccessID = bean.getiDCAccessID();
  
    String timestamp = bean.getTimestamp();
  
    String transactionID = bean.getTransactionID();
  
    String zoneID = bean.getZoneID();
    
    String token = FMCacheHolder.getToken(bean);
    try
    {
        Header header_iDCAccessId =
            new Header(new QName("", IDCACCESSID), iDCAccessID, new JAXBDataBinding(String.class));
        headerList.add(header_iDCAccessId);
        
        Header header_timestamp =
            new Header(new QName("", TIMESTAMP), timestamp, new JAXBDataBinding(String.class));
        headerList.add(header_timestamp);
        
        Header header_transactionID =
            new Header(new QName("", TRANSACTIONID), transactionID, new JAXBDataBinding(String.class));
        headerList.add(header_transactionID);
        
        Header header_zoneID = new Header(new QName("", ZONEID), zoneID, new JAXBDataBinding(String.class));
        headerList.add(header_zoneID);
        if (null != token)
        {
            Header header_token = new Header(new QName("", TOKEN), token, new JAXBDataBinding(String.class));
            headerList.add(header_token);
        }
    }
    catch (Exception e)
    {
        LOGGER.error("Exception happened in getSoapHeaders() ", e);
    }
    
}
 
开发者ID:eSDK,项目名称:esdk_cloud_fm_r3_native_java,代码行数:45,代码来源:MsgOutInterceptor.java


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