我正在使用具有使用apache-cxf实现的肥皂服务的springboot应用程序。我已经实现了SOAPHandler方法来处理肥皂消息和错误。从客户端handleMessage()调用soap服务时不会被调用。
//custom class implementing SOAPHandler
public final class JaxWsLoggingHandler implements
SOAPHandler<SOAPMessageContext> {
//this method will be called when server receives soap request
@Override
public boolean handleMessage(SOAPMessageContext context) {
SOAPMessage message = context.getMessage();
}
//this will be called when server throws error
@Override
public boolean handleFault(SOAPMessageContext context) {
SOAPMessage message = context.getMessage();
return true;
}
@Override
public void close(MessageContext context) {
}
@Override
public Set<QName> getHeaders() {
System.out.println("Inside getHeaders");
return Collections.emptySet();
}
}
我希望从客户端调用soap服务时会调用handleMessage(),但单独会调用getHeaders()。 没有弹簧启动,它可以正常工作