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