Skip to Content.
Sympa Menu

mace-opensaml-users - Re: org.xml.sax.SAXParseException: Content is not allowed in prolog

Subject: OpenSAML user discussion

List archive

Re: org.xml.sax.SAXParseException: Content is not allowed in prolog


Chronological Thread 
  • From: Paul Devine <>
  • To: Jason Pedone <>,
  • Subject: Re: org.xml.sax.SAXParseException: Content is not allowed in prolog
  • Date: Mon, 20 Sep 2004 12:56:31 -0700 (PDT)

Jason,
 
The code I am using to do this is the following:
 
byte[] responseBytes = Base64.decode(response);
SAMLResponse samlResponse = SAMLPOSTProfile.accept(response.getBytes(), validRecipientURL, responseWindowSecs, true);

 
and it seems to work fine. In the above code the response variable is a String containing the base64 encoded response.
 
Paul

Jason Pedone <> wrote:
All,

I'm trying to convert a base64 encoded SAML String
response into a SAMLResponse object, the code I am
executing to do so follows:

SAMLResponse obj_SAMLResponse = null;
if(str_SAMLResponse != null) {
try {
byte[] byte_arr_decodedBase64 =
Base64.decode(str_SAMLResponse);
obj_SAMLResponse = new SAMLResponse(
new
java.io.ByteArrayInputStream(byte_arr_decodedBase64));
} catch (SAMLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Base64DecodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

I am getting the following exception:

[http-8080-Processor41] ERROR opensaml.SAMLObject
fromStream - caught an exception while parsing a
stream:
Content is not allowed in prolog.
org.xml.sax.SAXParseException: Content is not allowed
in prolog.
at org.opensaml.SAMLObject.fromStream(Unknown Source)
at org.opensaml.SAMLResponse.(Unknown Source)

anyone have any ideas on what could cause this? I
know the exception means that there are some
unexpected characters before the root node, however I
print out the unencoded xml before I encode it and
there is nothing preceeding the root node. Its a
little hard to debug where I am decoding it b/c all I
have at that point is the base64 encoded SAML.

Thanks In Advance,

Jason P.



_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com


Do you Yahoo!?
vote.yahoo.com - Register online to vote today!


Archive powered by MHonArc 2.6.16.

Top of Page