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


Java SoapMessage.getEnvelope方法代码示例

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


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

示例1: handleRequest

import org.springframework.ws.soap.SoapMessage; //导入方法依赖的package包/类
@Override
public boolean handleRequest(MessageContext messageContext)
		throws WebServiceClientException {
	WebServiceMessage request = messageContext.getRequest();
	if(request instanceof SoapMessage) {
		SoapMessage soapMessage = (SoapMessage) request;
		SoapEnvelope envelope = soapMessage.getEnvelope();
		SoapHeader header = envelope.getHeader();
		RequestServerVersion rsv = new RequestServerVersion();

		try {
			Marshaller m = jaxbContext.createMarshaller();
			m.marshal(rsv, header.getResult());
		} catch (JAXBException e) {
			log.error("JAXBException raised while attempting to add RequestServerVersion to soap header " + rsv, e);
			throw new ExchangeWebServicesRuntimeException("JAXBException raised while attempting to add RequestServerVersion to soap header " + rsv, e);
		}
	}
	return true;
}
 
开发者ID:Bedework,项目名称:exchange-ws-client,代码行数:21,代码来源:RequestServerVersionClientInterceptor.java

示例2: handleRequest

import org.springframework.ws.soap.SoapMessage; //导入方法依赖的package包/类
@Override
public boolean handleRequest(MessageContext messageContext)
		throws WebServiceClientException {
	WebServiceMessage request = messageContext.getRequest();
	
	if(!isTimeZoneValid()){
		throw new ExchangeWebServicesRuntimeException("RequestServerTimeZoneInterceptor - the windowsTimeZoneID specified ("+this.windowsTimeZoneID+") does not match this systems default time zone ("+TimeZone.getDefault().getID()+")");
	}
	
	if (request instanceof SoapMessage) {
		SoapMessage soapMessage = (SoapMessage) request;
		SoapEnvelope envelope = soapMessage.getEnvelope();
		SoapHeader header = envelope.getHeader();

		TimeZoneContext tzc = new TimeZoneContext();
		TimeZoneDefinitionType timeZoneDef = new TimeZoneDefinitionType();
		timeZoneDef.setId(windowsTimeZoneID);
		tzc.setTimeZoneDefinition(timeZoneDef);

		try {
			Marshaller m = jaxbContext.createMarshaller();
			m.marshal(tzc, header.getResult());
		} catch (JAXBException e) {
			log.error(
					"JAXBException raised while attempting to add TimeZoneContext to soap header "
							+ tzc, e);
			throw new ExchangeWebServicesRuntimeException(
					"JAXBException raised while attempting to add TimeZoneContext to soap header "
							+ tzc, e);
		}
	}
	return true;
}
 
开发者ID:Bedework,项目名称:exchange-ws-client,代码行数:34,代码来源:RequestServerTimeZoneInterceptor.java

示例3: handleRequest

import org.springframework.ws.soap.SoapMessage; //导入方法依赖的package包/类
@Override
public boolean handleRequest(MessageContext messageContext)
		throws WebServiceClientException {
	WebServiceMessage request = messageContext.getRequest();
	if(request instanceof SoapMessage) {
		SoapMessage soapMessage = (SoapMessage) request;

		ConnectingSIDType connectingSID = connectingSIDSource.getConnectingSID(soapMessage, messageContext);
		if(connectingSID != null) {
			ExchangeImpersonation impersonation = new ExchangeImpersonation();
			impersonation.setConnectingSID(connectingSID);
			
			SoapEnvelope envelope = soapMessage.getEnvelope();
			SoapHeader header = envelope.getHeader();

			try {
				Marshaller m = jaxbContext.createMarshaller();
				m.marshal(impersonation, header.getResult());
				
			} catch (JAXBException e) {
				log.error("JAXBException raised while attempting to add ExchangeImpersonation header with SID: " + connectingSID, e);
				throw new ExchangeImpersonationException("JAXBException raised while attempting to add ExchangeImpersonation header with SID: " + connectingSID, e);
			}
		} else {
			if(log.isDebugEnabled()) {
				log.debug("no connectingSID found for " + soapMessage);
			}
		}
	}

	return true;
}
 
开发者ID:Bedework,项目名称:exchange-ws-client,代码行数:33,代码来源:ExchangeImpersonationClientInterceptor.java

示例4: assertSoapMessage

import org.springframework.ws.soap.SoapMessage; //导入方法依赖的package包/类
/**
 * Assert that message is SOAP message (wrapped in SOAP envelope).
 */
public MessageValidator assertSoapMessage() {
	SoapMessage soapMessage = getSoapMessage();
	try
	{
		soapMessage.getEnvelope();
	}
	catch(SoapEnvelopeException e)
	{
		throw new WsTestException("Message is not a SOAP message",e);
	}
	return this;
}
 
开发者ID:lukas-krecan,项目名称:spring-ws-test,代码行数:16,代码来源:MessageValidator.java


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