XML.fromXml not Working

#1

I have an xml document that I am retrieving using the C3 REST type. When I try to parse it using XML.fromXml I am getting an error message. I am able to use the DOMParser to process the xml document without any error messages.

Here is the sample code that I am calling:

var entity = result.entity.toString();
var x = XML.fromXml(entity);

Here is the error message:

{
  "id" : "6684.43139",
  "key" : "c3.love.typesys.obj.pipe.ObjValueIteratorBase_badField",
  "template" : "Invalid field name {} for type {} at {}",
  "parameters" : [ "ID", "XML", "XML at Line number = 1\nColumn number = 143\nSystem Id = null\nPublic Id = null\nLocation Uri= null\nCharacterOffset = 164\n" ],
  "codes" : [ "BadField" ]
}

and here is the xml document:

<Assertion ID="_xxxx-xxxx-xxxx-xxxx-xxxx" IssueInstant="2018-08-30T20:19:56.186Z" Version="2.0" xmlns="urn:oasis:names:tc:SAML:2.0:assertion">
	<Issuer>https://aws.xxxx.net/corests/issue.svc</Issuer>
	<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
		<SignedInfo>
			<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
			<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" />
			<Reference URI="#_xxxx-xxxx-xxxx-xxxx-xxxx">
				<Transforms>
					<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
					<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
				</Transforms>
				<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
				<DigestValue>sdfgsdfgsdfgsdfgsdfgsdfgsdfgsdfgsdfgsdfgsdfgsdfg=</DigestValue>
			</Reference>
		</SignedInfo>
		<SignatureValue>asdfasdfasfasdfasdfasdfasdfasdf==</SignatureValue>
		<KeyInfo>
			<X509Data>
				<X509Certificate>zxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcv=</X509Certificate>
			</X509Data>
		</KeyInfo>
	</Signature>
	<Subject>
		<NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress">test@user.com</NameID>
		<SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
			<SubjectConfirmationData NotOnOrAfter="2018-08-30T20:24:17.585Z" Recipient="https://predev.c3iot.com/auth/1/login" />
		</SubjectConfirmation>
	</Subject>
	<Conditions NotBefore="2018-08-30T20:19:56.186Z" NotOnOrAfter="2018-08-30T23:19:56.186Z">
		<AudienceRestriction>
			<Audience>https://com.user.his/Hub</Audience>
		</AudienceRestriction>
	</Conditions>
	<AttributeStatement>
		<Attribute Name="http://schemas.user.com/key">
			<AttributeValue>xxxx-xxxx-xxxx-xxxx-xxxx</AttributeValue>
		</Attribute>
		<Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name">
			<AttributeValue>John Smith</AttributeValue>
		</Attribute>
		<Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress">
			<AttributeValue>test@user.com</AttributeValue>
		</Attribute>
		<Attribute Name="http://schemas.user.com/method">
			<AttributeValue>Password</AttributeValue>
		</Attribute>
		<Attribute Name="http://schemas.user.com/domain">
			<AttributeValue>xxxx-xxxx-xxxx-xxxx-xxxx</AttributeValue>
		</Attribute>
		<Attribute Name="http://schemas.user.com/branch">
			<AttributeValue>Test Enterprise</AttributeValue>
		</Attribute>
		<Attribute Name="http://schemas.user.com/id">
			<AttributeValue>42</AttributeValue>
		</Attribute>
		<Attribute Name="http://schemas.user.com/C3Groups">
			<AttributeValue>qqqqqqqqqqqqq</AttributeValue>
			<AttributeValue>wwwwwwwwwwwww</AttributeValue>
			<AttributeValue>rrrrrrrrrrrrr</AttributeValue>
		</Attribute>
		<Attribute Name="http://schemas.user.com/instant">
			<AttributeValue>2018-08-30T17:24:17.069Z</AttributeValue>
		</Attribute>
	</AttributeStatement>
</Assertion>
0 Likes