2017-02-13 9 views
0

Spring WSでキャッチする方法は?NoEndpointFoundExceptionSpring WSのcatch EndpointNotFound WS

デフォルトでは、MessageDispatcher.dispath()は適切なエンドポイントがない場合にNoEndpointFoundExceptionをスローしますが、その後WebServiceMessageReceiverObjectSupport.handleConnection()は例外を隠すだけです。私の考えでは、私はそれを自分で捕まえるべきです。

カスタムEndpointMappingをMessageDispatcher.getEndpointMappings().add()で追加してその例外をスローするのは良い考えですか?

答えて

0

私は、次の解決策を見つける:

@Component 
@Order(Ordered.LOWEST_PRECEDENCE) 
public class NoEndpointFoundEndpointMapping implements EndpointMapping { 

    @Override 
    public EndpointInvocationChain getEndpoint(MessageContext messageContext) throws Exception { 

     throw new MyCustomException(...); 
    } 
} 
関連する問題