View Single Post
  #1 (permalink)  
Old 02-26-2008, 11:36 AM
jrjespersen
Guest
 
Posts: n/a
Default Issue with GetUserProfile() web service method and Encrypted passwords

I am having an issue with retrieving a user profile with GetUserProfile() method. It appears to be related to password encryption. When I call the method for several of our profiles, the web service proxy class throws an exception referencing an error in the XML document:

Quote:
There is an error in XML document (1, 1202). '', hexadecimal value 0x1D, is an invalid character. Line 1, position 1102.
I think the password property should either be decrypted before being put in the response or should be encapsulate in a CDATA tag. I would tend to lean toward decrypting the password - otherwise the web service API doesn't provide a facility to validate the password and change it if necessary.

The XML being returned from the web service for one of the requests is:

HTML Code:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<soap:Body>
		<GetUserProfileResponse xmlns="http://prezzatech.com/Checkbox/Services">
			<GetUserProfileResult>
				<SimpleNameValueOfObjectObject>
					<Name xsi:type="xsd:string">UniqueIdentifier</Name>
					<Value xsi:type="xsd:string">testuser</Value>
				</SimpleNameValueOfObjectObject>
				<SimpleNameValueOfObjectObject>
					<Name xsi:type="xsd:string">UserName</Name>
					<Value xsi:type="xsd:string">testuser</Value>
				</SimpleNameValueOfObjectObject>
				<SimpleNameValueOfObjectObject>
					<Name xsi:type="xsd:string">Email</Name>
					<Value xsi:type="xsd:string">testuser@example.com</Value>
				</SimpleNameValueOfObjectObject>
				<SimpleNameValueOfObjectObject>
					<Name xsi:type="xsd:string">GUID</Name>
					<Value xmlns:q1="http://microsoft.com/wsdl/types/" xsi:type="q1:guid">34986b00-9013-4b06-a014-bfe25219a265</Value>
				</SimpleNameValueOfObjectObject>
				<SimpleNameValueOfObjectObject>
					<Name xsi:type="xsd:string">Password</Name>
					<Value xsi:type="xsd:string">_M?;Z?e??'?????</Value>
				</SimpleNameValueOfObjectObject>
			</GetUserProfileResult>
		</GetUserProfileResponse>
	</soap:Body>
</soap:Envelope>
This is the stack trace at the point of the exception:

Code:
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at UserManagementServiceProxy.GetUserProfile(Guid contextToken, String userIdentity)
   at CheckboxTester.CheckboxTesterForm.GetUserProfile(String UserID)
   at CheckboxTester.CheckboxTesterForm.GetProfileFromForm()
Reply With Quote