Opensaml 错误接收正确的解组器 [英] Opensaml error receiving correct unmarshaller

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

问题描述

我在 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?

推荐答案

我发现没有 unmarshallers register 因为库中没有初始化:

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

重要代码:

// Initialize the library
DefaultBootstrap.bootstrap();

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆