本文介绍了Opensaml错误接收正确的unmarshaller的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在opensaml2.6上运行此代码

I am running this code at opensaml2.6

Element metadataRoot = document.getDocumentElement();

// Unmarshall
UnmarshallerFactory unmarshallerFactory = Configuration.getUnmarshallerFactory();
Unmarshaller unmarshaller = unmarshallerFactory.getUnmarshaller(metadataRoot);
if (unmarshaller == null) {
    System.out.println("Error receiving unmarshaller for this document.");
    return;
}

对于文件

<?xml version="1.0" encoding="UTF-8"?><saml2:EncryptedAssertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">

Unmarshaller 返回 null ,你能帮我解决一下如何查找正确的 Unmarshaller 以及它如何在opensaml中运行?

Unmarshaller return a null, Can you help me to undertand how are the criterias to lookup the correct Unmarshaller and how this works at opensaml?

推荐答案

我发现由于库中没有初始化,因此没有未经编号的注册:

I found that there is not unmarshallers register as there is not initialization in the library:

重要的一段代码:

// Initialize the library
DefaultBootstrap.bootstrap();

这篇关于Opensaml错误接收正确的unmarshaller的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 20:23