9

このコードを 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 でどのように機能するかを理解するのを手伝ってもらえますか?

4

2 に答える 2

22

ライブラリに初期化がないため、unmarshallers レジスタがないことがわかりました。

重要なコード:

// Initialize the library
DefaultBootstrap.bootstrap();
于 2014-08-01T06:13:44.280 に答える