本文整理汇总了Java中org.springframework.ws.soap.SoapFault类的典型用法代码示例。如果您正苦于以下问题:Java SoapFault类的具体用法?Java SoapFault怎么用?Java SoapFault使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SoapFault类属于org.springframework.ws.soap包,在下文中一共展示了SoapFault类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: customizeFault
import org.springframework.ws.soap.SoapFault; //导入依赖的package包/类
/**
* Permite personalizar la propiedad Fault.
*
* @param endopoint
* Endpoint ejecutado.
* @param ex
* Excepcion a ser manejada.
* @param fault
* Fault creado
*/
@Override
public void customizeFault(Object endpoint, Exception ex, SoapFault fault) {
Object realEndPoint;
if (endpoint instanceof MethodEndpoint) {
realEndPoint = ((MethodEndpoint) endpoint).getBean();
} else {
realEndPoint = endpoint;
}
if (ex instanceof HTTPException) {
handleHTTPException(fault, (HTTPException) ex);
} else {
logException(realEndPoint, ex);
}
}
开发者ID:fpuna-cia,项目名称:karaku,代码行数:27,代码来源:EndpointExceptionResolver.java
示例2: resolveExceptionInternal
import org.springframework.ws.soap.SoapFault; //导入依赖的package包/类
@Override
protected final boolean resolveExceptionInternal(MessageContext messageContext, Object endpoint, Exception ex) {
Assert.isInstanceOf(SoapMessage.class, messageContext.getResponse(),
"SimpleSoapExceptionResolver requires a SoapMessage");
if (throttlingAsServerError && ex instanceof ThrottlingExceededException) {
// no SOAP fault => server error
return false;
} else {
SoapMessage response = (SoapMessage) messageContext.getResponse();
String faultString = StringUtils.hasLength(ex.getMessage()) ? ex.getMessage() : ex.toString();
SoapBody body = response.getSoapBody();
SoapFault fault = body.addServerOrReceiverFault(faultString, getLocale());
customizeFault(messageContext, endpoint, ex, fault);
return true;
}
}
开发者ID:integram,项目名称:cleverbus,代码行数:19,代码来源:ErrorCodeAwareSoapExceptionResolver.java
示例3: customizeFault
import org.springframework.ws.soap.SoapFault; //导入依赖的package包/类
@Override
protected void customizeFault(Object endpoint, Exception ex, SoapFault fault) {
if(ex instanceof ExampleException) {
try {
addFaultDetail(endpoint, (ExampleException)ex, fault);
} catch (JAXBException e) {
e.printStackTrace();
}
}
}
开发者ID:kevinbayes,项目名称:springframework-examples,代码行数:11,代码来源:JaxbCustomSoapFaultMappingExceptionResolver.java
示例4: addFaultDetail
import org.springframework.ws.soap.SoapFault; //导入依赖的package包/类
private void addFaultDetail(Object endpoint, ExampleException exception, SoapFault fault) throws JAXBException {
final SoapFaultDetail detail = fault.addFaultDetail();
final Marshaller marshaller = context.createMarshaller();
final Result result = detail.getResult();
final FaultType type = factory.createFaultType();
type.setCode(exception.getCode().name());
type.setMessage(exception.getCause().getMessage());
marshaller.marshal(factory.createExampleFault(type), result);
}
开发者ID:kevinbayes,项目名称:springframework-examples,代码行数:13,代码来源:JaxbCustomSoapFaultMappingExceptionResolver.java
示例5: handleFault
import org.springframework.ws.soap.SoapFault; //导入依赖的package包/类
public void handleFault(final Retning retning, final EbmsContext context, final SoapMessage soapMessage, final String endpoint) {
SoapBody soapBody = soapMessage.getSoapBody();
SoapFault soapFault = soapBody.getFault();
logg.soapfault(endpoint, getOrgNr(context), soapFault);
if (soapMessage.getSoapHeader().examineHeaderElements(Constants.MESSAGING_QNAME).hasNext()) {
Messaging messaging = MessagingMarshalling.getMessaging(jaxb2Marshaller, soapMessage);
for (SignalMessage signalMessage : messaging.getSignalMessages()) {
for (Error error : signalMessage.getErrors()) {
logg.ebmserror(endpoint, getOrgNr(context), retning, error, signalMessage.getMessageInfo(), getMpcFromSignal(context, signalMessage), getConversationId(context), getInstanceIdentifier(context));
}
}
}
}
开发者ID:digipost,项目名称:sdp-shared,代码行数:15,代码来源:TransactionLog.java
示例6: customizeFault
import org.springframework.ws.soap.SoapFault; //导入依赖的package包/类
/**
* The soap fault actor is {@link #TARGET_WS_ACTOR} when the exception was a
* {@link ForwardingEndpointTargetException}. In that case the error is triggered by a fault communicating with the
* target webservice. In all other cases the actor is {@link #PROXY_ACTOR} indicating it is a problem from the proxy
* module itself.
*/
@Override
protected void customizeFault(Object endpoint, Exception exception, SoapFault fault) {
if (exception instanceof ForwardingEndpointTargetException) {
fault.setFaultActorOrRole(TARGET_WS_ACTOR + domain);
} else {
fault.setFaultActorOrRole(PROXY_ACTOR + domain);
}
}
开发者ID:koen-serneels,项目名称:ws-proxy,代码行数:15,代码来源:ProxySoapFaultMappingExceptionResolver.java
示例7: exceptionResolver
import org.springframework.ws.soap.SoapFault; //导入依赖的package包/类
@Bean
public EndpointExceptionResolver exceptionResolver(){
return new SimpleSoapExceptionResolver(){
@Override
protected void customizeFault(MessageContext messageContext, Object endpoint, Exception ex, SoapFault fault) {
if (!(ex instanceof IllegalArgumentException)){
messageContext.clearResponse();
SoapMessage response = (SoapMessage) messageContext.getResponse();
String faultString = StringUtils.hasLength(ex.getMessage()) ? ex.getMessage() : ex.toString();
SoapBody body = response.getSoapBody();
body.addServerOrReceiverFault("General server failure", getLocale());
}
}
};
}
开发者ID:NetsOSS,项目名称:embedded-jetty-sample,代码行数:16,代码来源:WsServletConfiguration.java
示例8: customizeFault
import org.springframework.ws.soap.SoapFault; //导入依赖的package包/类
@Override
protected void customizeFault(Object endpoint, Exception exception, SoapFault fault)
{
// create the corresponding jaxb element of an EndpointException
if (exception instanceof EndpointException)
{
// get the result inside the fault detail to marshal to
Result result = fault.addFaultDetail().getResult();
//create a new WS entity EndpointException and setting its code and message to be equal to those of actual thrown Exception
CMEndpointExceptionBean endpointException = new CMEndpointExceptionBean();
endpointException.setCode(((EndpointException) exception).getCode());
endpointException.setMessage(exception.getMessage());
JAXBElement<CMEndpointExceptionBean> soapFaultDetails = new ObjectFactory().createEndpointException(endpointException);
// marshal the EndpointException WS entity to the details tag of a SOAP Fault message
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setContextPath(jaxb2MarshallerContextPath);
try {
//When setting the marshaller in applicationContext.xml, Spring calls by default afterPropertiesSet() after setting the
//marshaller properties; from Java, I have to do it before marshalling an object
marshaller.afterPropertiesSet();
} catch (Exception e) {
logger.error("Error while setting up Jaxb2Marshaller!");
}
marshaller.marshal(soapFaultDetails, result);
} else {
super.customizeFault(endpoint, exception, fault);
}
}
开发者ID:CodeSphere,项目名称:termitaria,代码行数:31,代码来源:EndpointExceptionResolver.java
示例9: customizeFault
import org.springframework.ws.soap.SoapFault; //导入依赖的package包/类
@Override
protected void customizeFault(Object endpoint, Exception exception, SoapFault fault)
{
// create the corresponding jaxb element of an EndpointException
if (exception instanceof EndpointException)
{
// get the result inside the fault detail to marshal to
Result result = fault.addFaultDetail().getResult();
//create a new WS entity EndpointException and setting its code and message to be equal to those of actual thrown Exception
TSEndpointExceptionBean reportsEndpointExceptionBean = new TSEndpointExceptionBean();
reportsEndpointExceptionBean.setCode(((EndpointException) exception).getCode());
reportsEndpointExceptionBean.setMessage(exception.getMessage());
JAXBElement<TSEndpointExceptionBean> soapFaultDetails = new ObjectFactory().createEndpointException(reportsEndpointExceptionBean);
// marshal the EndpointException WS entity to the details tag of a SOAP Fault message
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setContextPath(jaxb2MarshallerContextPath);
try {
//When setting the marshaller in applicationContext.xml, Spring calls by default afterPropertiesSet() after setting the
//marshaller properties; from Java, I have to do it before marshalling an object
marshaller.afterPropertiesSet();
} catch (Exception e) {
logger.error("Error while setting up Jaxb2Marshaller!");
}
marshaller.marshal(soapFaultDetails, result);
} else {
super.customizeFault(endpoint, exception, fault);
}
}
开发者ID:CodeSphere,项目名称:termitaria,代码行数:31,代码来源:EndpointExceptionResolver.java
示例10: customizeFault
import org.springframework.ws.soap.SoapFault; //导入依赖的package包/类
@Override
protected void customizeFault(Object endpoint, Exception exception, SoapFault fault)
{
// create the corresponding jaxb element of an EndpointException
if (exception instanceof EndpointException)
{
// get the result inside the fault detail to marshal to
Result result = fault.addFaultDetail().getResult();
//create a new WS entity EndpointException and setting its code and message to be equal to those of actual thrown Exception
OMEndpointExceptionBean endpointException = new OMEndpointExceptionBean();
endpointException.setCode(((EndpointException) exception).getCode());
endpointException.setMessage(exception.getMessage());
JAXBElement<OMEndpointExceptionBean> soapFaultDetails = new ObjectFactory().createEndpointException(endpointException);
// marshal the EndpointException WS entity to the details tag of a SOAP Fault message
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setContextPath(jaxb2MarshallerContextPath);
try {
//When setting the marshaller in applicationContext.xml, Spring calls by default afterPropertiesSet() after setting the
//marshaller properties; from Java, I have to do it before marshalling an object
marshaller.afterPropertiesSet();
} catch (Exception e) {
logger.error("Error while setting up Jaxb2Marshaller!");
}
marshaller.marshal(soapFaultDetails, result);
} else {
super.customizeFault(endpoint, exception, fault);
}
}
开发者ID:CodeSphere,项目名称:termitaria,代码行数:31,代码来源:EndpointExceptionResolver.java
示例11: customizeFault
import org.springframework.ws.soap.SoapFault; //导入依赖的package包/类
@Override
protected void customizeFault(Object endpoint, Exception exception, SoapFault fault)
{
// create the corresponding jaxb element of an EndpointException
if (exception instanceof EndpointException)
{
// get the result inside the fault detail to marshal to
Result result = fault.addFaultDetail().getResult();
//create a new WS entity EndpointException and setting its code and message to be equal to those of actual thrown Exception
AuditEndpointExceptionBean reportsEndpointExceptionBean = new AuditEndpointExceptionBean();
reportsEndpointExceptionBean.setCode(((EndpointException) exception).getCode());
reportsEndpointExceptionBean.setMessage(exception.getMessage());
JAXBElement<AuditEndpointExceptionBean> soapFaultDetails = new ObjectFactory().createEndpointException(reportsEndpointExceptionBean);
// marshal the EndpointException WS entity to the details tag of a SOAP Fault message
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setContextPath(jaxb2MarshallerContextPath);
try {
//When setting the marshaller in applicationContext.xml, Spring calls by default afterPropertiesSet() after setting the
//marshaller properties; from Java, I have to do it before marshalling an object
marshaller.afterPropertiesSet();
} catch (Exception e) {
logger.error("Error while setting up Jaxb2Marshaller!");
}
marshaller.marshal(soapFaultDetails, result);
} else {
super.customizeFault(endpoint, exception, fault);
}
}
开发者ID:CodeSphere,项目名称:termitaria,代码行数:31,代码来源:EndpointExceptionResolver.java
示例12: soapfault
import org.springframework.ws.soap.SoapFault; //导入依赖的package包/类
public void soapfault(final String endpoint, final String orgnr, final SoapFault soapFault) {
LOG.warn("[{}] [{}] {} fault:[{}]", endpoint, toLoggable(orgnr), SOAPFAULT, soapFault.getFaultStringOrReason());
}
开发者ID:digipost,项目名称:sdp-shared,代码行数:4,代码来源:TransaksjonsLogg.java
示例13: getSoapFault
import org.springframework.ws.soap.SoapFault; //导入依赖的package包/类
private SoapFault getSoapFault(final SoapMessage soapMessage) {
SoapBody body = soapMessage.getSoapBody();
return body != null ? body.getFault() : null;
}
开发者ID:digipost,项目名称:sdp-shared,代码行数:5,代码来源:MessageSenderSoapFaultException.java
示例14: getSoapFault
import org.springframework.ws.soap.SoapFault; //导入依赖的package包/类
/**
* Returns SOAP fault.
* @return
*/
public SoapFault getSoapFault() {
assertSoapFault();
return getSoapMessage().getSoapBody().getFault();
}
开发者ID:lukas-krecan,项目名称:spring-ws-test,代码行数:9,代码来源:MessageValidator.java
示例15: customizeFault
import org.springframework.ws.soap.SoapFault; //导入依赖的package包/类
/**
* Adds error code element detail into SOAP fault.
*
* @param messageContext current message context
* @param endpoint the executed endpoint, or <code>null</code> if none chosen at the time of the exception
* @param ex the exception that got thrown during endpoint execution
* @param fault the SOAP fault to be customized.
*/
protected void customizeFault(MessageContext messageContext, Object endpoint, Exception ex, SoapFault fault) {
if (ex instanceof IntegrationException) {
SoapFaultDetail detail = fault.addFaultDetail();
detail.addFaultDetailElement(ERR_CODE).addText(((IntegrationException) ex).getError().getErrorCode());
}
}
开发者ID:integram,项目名称:cleverbus,代码行数:15,代码来源:ErrorCodeAwareSoapExceptionResolver.java
注:本文中的org.springframework.ws.soap.SoapFault类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论