本文整理汇总了Java中org.springframework.ws.client.WebServiceClientException类的典型用法代码示例。如果您正苦于以下问题:Java WebServiceClientException类的具体用法?Java WebServiceClientException怎么用?Java WebServiceClientException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WebServiceClientException类属于org.springframework.ws.client包,在下文中一共展示了WebServiceClientException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleRequest
import org.springframework.ws.client.WebServiceClientException; //导入依赖的package包/类
@Override
public boolean handleRequest(MessageContext messageContext) throws WebServiceClientException {
TransportContext transportContext = TransportContextHolder.getTransportContext();
WebServiceConnection webServiceConnection = transportContext.getConnection();
final String tenant = TenantContextHolder.getContext().getTenant();
if (webServiceConnection instanceof HeadersAwareSenderWebServiceConnection) {
if (StringUtils.hasText(tenant)) {
try {
((HeadersAwareSenderWebServiceConnection) webServiceConnection).addRequestHeader(getHeaderName(), tenant);
} catch (IOException e) {
throw new WebServiceIOException("Error setting header '" + getHeaderName() + "' on connection.", e);
}
}
}
return true;
}
示例2: handleResponse
import org.springframework.ws.client.WebServiceClientException; //导入依赖的package包/类
@SuppressWarnings("serial")
@Override
public boolean handleResponse(MessageContext messageContext) {
String conversationId = null;
try {
MessageHeader header = extractMessageHeaderFromMessageContext(messageContext);
conversationId = header.getConversationId();
} catch (JAXBException | NullPointerException e) {
LOG.fatal("Error occurred during retrieving session token", e);
}
if (conversationId == null) {
throw new WebServiceClientException("Couldn't retrieve session token from message") {
};
}
logTokenAndConversationIdFromMessage("", conversationId);
sessionPool.returnToPool(conversationId);
return true;
}
示例3: handleRequest
import org.springframework.ws.client.WebServiceClientException; //导入依赖的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;
}
示例4: afterCompletion
import org.springframework.ws.client.WebServiceClientException; //导入依赖的package包/类
@Override
public void afterCompletion(MessageContext context, Exception ex) throws WebServiceClientException {
WebServiceMessage request = context.getRequest();
WebServiceMessage response = context.getResponse();
SoapMessage message = new SoapMessage();
message.setService(serviceName);
message.setRequest(formatMessage(request));
message.setResponse(formatMessage(response));
messageService.save(message);
}
示例5: handleResponse
import org.springframework.ws.client.WebServiceClientException; //导入依赖的package包/类
@Override
public boolean handleResponse(MessageContext messageContext) throws WebServiceClientException {
try {
MessageHeader header = extractMessageHeaderFromMessageContext(messageContext);
if (!isSessionCloseRS(header)) {
throw new UnsupportedOperationException("This interceptors works with SessionCloseRQ only");
}
} catch (JAXBException | NullPointerException e) {
LOG.fatal("Error occurred during retrieving session token", e);
}
return true;
}
示例6: handleResponse
import org.springframework.ws.client.WebServiceClientException; //导入依赖的package包/类
@SuppressWarnings("serial")
@Override
public boolean handleResponse(MessageContext messageContext) throws WebServiceClientException {
String token = null;
String conversationId = null;
Security security = null;
try {
security = extractSecurityFromMessageContext(messageContext);
MessageHeader header = extractMessageHeaderFromMessageContext(messageContext);
if (!header.getAction().equalsIgnoreCase("SessionCreateRS")) {
throw new UnsupportedOperationException("This interceptors works with SessionCreateRQ only");
}
token = security.getBinarySecurityToken();
conversationId = header.getConversationId();
} catch (JAXBException | NullPointerException e) {
LOGGER.fatal("Error occurred during retrieving session token", e);
}
LOGGER.info("Creating session object for ConversationID: " + conversationId);
if (token == null | conversationId == null) {
throw new WebServiceClientException("Couldn't retrieve session token from message") {
};
}
logTokenAndConversationIdFromMessage(token, conversationId);
sessionPool.addToPool(security);
return true;
}
示例7: handleRequest
import org.springframework.ws.client.WebServiceClientException; //导入依赖的package包/类
@Override
public boolean handleRequest(MessageContext messageContext) throws WebServiceClientException {
try {
logRequestMessage(messageContext);
} catch (IOException e) {
LOGGER.error(e);
return false;
}
return true;
}
示例8: handleResponse
import org.springframework.ws.client.WebServiceClientException; //导入依赖的package包/类
@Override
public boolean handleResponse(MessageContext messageContext) throws WebServiceClientException {
try {
logResponseMessage(messageContext);
} catch (IOException e) {
LOGGER.error(e);
return false;
}
return true;
}
示例9: handleRequest
import org.springframework.ws.client.WebServiceClientException; //导入依赖的package包/类
@Override
public boolean handleRequest(MessageContext messageContext) throws WebServiceClientException {
if (enableLogTiming) {
messageContext.setProperty(LOG_TIME_PROPERTY, System.currentTimeMillis());
}
if (enableLogRequest && loggerRequest.isDebugEnabled()) {
try {
loggerRequest.debug("Request: {}", getMessage(messageContext.getRequest()));
} catch(Exception e) {
LOG.error("Cannot Log Request", e);
}
}
return true;
}
开发者ID:SpartaTech,项目名称:sparta-spring-webservice-utils,代码行数:15,代码来源:PayloadLoggingClientInterceptor.java
示例10: handleRequest
import org.springframework.ws.client.WebServiceClientException; //导入依赖的package包/类
@Override
public boolean handleRequest(final MessageContext messageContext) throws WebServiceClientException {
try {
transactionLog.handleOutgoing(EbmsContext.from(messageContext), (SoapMessage) messageContext.getRequest(), "sender");
} catch (Exception ex) {
LOG.warn("Feil under klienttransaksjonslogging i handleRequest", ex);
}
return true;
}
示例11: handleResponse
import org.springframework.ws.client.WebServiceClientException; //导入依赖的package包/类
@Override
public boolean handleResponse(final MessageContext messageContext) throws WebServiceClientException {
try {
transactionLog.handleIncoming(EbmsContext.from(messageContext), (SoapMessage) messageContext.getResponse(), "sender");
} catch (Exception ex) {
LOG.warn("Feil under klienttransaksjonslogging i handleResponse", ex);
}
return true;
}
示例12: handleFault
import org.springframework.ws.client.WebServiceClientException; //导入依赖的package包/类
@Override
public boolean handleFault(final MessageContext messageContext) throws WebServiceClientException {
try {
transactionLog.handleFault(INNKOMMENDE, EbmsContext.from(messageContext), (SoapMessage) messageContext.getResponse(), "sender");
} catch (Exception ex) {
LOG.warn("Feil under klienttransaksjonslogging i handleFault", ex);
}
return true;
}
示例13: handleResponse
import org.springframework.ws.client.WebServiceClientException; //导入依赖的package包/类
@Override
public boolean handleResponse(final MessageContext messageContext) throws WebServiceClientException {
if (soapLog.getLogLevel() == SoapLog.LogLevel.ALL || soapLog.isTraceEnabled()) {
soapLog.logMessageSource("Utgående request: ", soapLog.getSource(messageContext.getRequest()));
soapLog.logMessageSource("Innkommende response: ", soapLog.getSource(messageContext.getResponse()));
}
return true;
}
示例14: handleFault
import org.springframework.ws.client.WebServiceClientException; //导入依赖的package包/类
@Override
public boolean handleFault(final MessageContext messageContext) throws WebServiceClientException {
if (soapLog.getLogLevel() == SoapLog.LogLevel.FAULTS_ONLY || soapLog.getLogLevel() == SoapLog.LogLevel.ALL || soapLog.isTraceEnabled()) {
soapLog.logMessageSource("Utgående feilende request: ", soapLog.getSource(messageContext.getRequest()));
soapLog.logMessageSource("Innkommende fault: ", soapLog.getSource(messageContext.getResponse()));
}
return true;
}
示例15: handleRequest
import org.springframework.ws.client.WebServiceClientException; //导入依赖的package包/类
@Override
public boolean handleRequest(final MessageContext messageContext) throws WebServiceClientException {
SoapMessage requestMessage = (SoapMessage) messageContext.getRequest();
Element bodyElement = (Element) ((DOMSource) requestMessage.getSoapBody().getSource()).getNode();
bodyElement.setAttributeNS(Constants.WSSEC_UTILS_NAMESPACE, "wsu:Id", "soapBody");
bodyElement.setIdAttributeNS(Constants.WSSEC_UTILS_NAMESPACE, "Id", true);
SoapHeader soapHeader = requestMessage.getSoapHeader();
EbmsContext context = EbmsContext.from(messageContext);
SoapHeaderElement ebmsHeader = soapHeader.addHeaderElement(MESSAGING_QNAME);
ebmsHeader.setMustUnderstand(true);
context.processRequest(context, ebmsHeader, requestMessage);
return true;
}