내 서버에서 SOAP 요청의 보안을 확인하기 위해 wss4j를 사용할 때 문제가 발생했습니다. 여기에있는 보안 헤더를 확인하는 데 사용하는 코드 부분이 있습니다. 비누 요청 (나는 SOAPHandler 구현의 handleMessage 방법에있어) : 요청에웹 서비스를 두 번 호출 할 때 Wss4j 및 soaphandler 오류가 발생했습니다.
// get the crypto file to retrieve dedicated certificate
final Crypto iCertificateStore = WSKeystoreManagement.getCryptoFile();
final WSSecurityEngine iEngine = new WSSecurityEngine();
// Add the default config file to the engine
final WSSConfig iConfig = WSSConfig.getNewInstance();
iEngine.setWssConfig(iConfig);
try {
// check security header
final List<WSSecurityEngineResult> iSecurityParts =
iEngine.processSecurityHeader(aDocument, null, null, iCertificateStore);
} catch (final WSSecurityException iException) { ...}
이 내가 첫 번째, 모든 확인을가는 웹 서비스를 호출하고있을 때, 서명과 타임 스탬프이며, 요청이 처리되고, 작은 자바 프로젝트를 사용하여 웹 서비스를 호출하면 프로그램이 응답을 검색하고 올바르게 끝냅니다. 하지만 다시 프로그램을 시작하지만 이번에는 서버 측에서 검사가 작동하지 않습니다.
if (validateContext == null) {
throw new NullPointerException("validateContext cannot be null");
}
if (validated) {
return validationStatus;
}
Data data = dereference(validateContext);
calcDigestValue = transform(data, validateContext);
if (log.isDebugEnabled()) {
log.debug("Expected digest: " + Base64.encode(digestValue));
log.debug("Actual digest: " + Base64.encode(calcDigestValue));
}
calcDigestValue이 다른이 시간, 나는 그 이유를 찾을 수 없습니다 : 나는 문제가 어디에서 왔는지 어디, 내가 DOMReference.validate 방법에 여기 도착했습니다 확인하기 위해 WSS4J 코드에서 찾아 봤는데 ... 아무도 그것에 대해 알 수 있습니까?
감사합니다.
편집 : 내 연구가 진행 중입니다. 문제는 요청 봉투의 본문이 클라이언트와 서버 사이의 어딘가에서 변경된다는 사실에서 비롯됩니다 ... 클라이언트를 확인한 후 시체가 거기에서 바뀌지 않는다고 거의 확신한다. 이러한 변경 사항은 두 번째 호출에만 나타나지만 여전히 이유를 모르겠습니까 ??
두 번째 요청에서 어떤 행동을 보이나요? 예외가 있습니까? 두 요청 사이에서 정확히 무엇이 바뀌 었습니까? – Pace