G
Guest
Hi,
I am using the XmlSerializer class to deserialize a file, please see
attached code.
This works fine from a windows form, but fails when called from an asp.net
web service. Unfortuantely I can't get a proper error message, the browser
just a "this page cannot be displayed" message.
I have read that the account the service runs under requires write access to
the .net framework temp directory which it has.
Could anyone give me any pointers as to why this could be failing.
Many thanks for any suggestions,
Steve
Dim serializer As New XmlSerializer(GetType(MyClass))
Dim fstFileStream As FileStream
Dim MyObject As MyClass
'Deserialise the file to create the main web site object
serializer = New XmlSerializer(GetType(MyClass))
fstFileStream = New FileStream(Me.SerialiseFileName,
FileMode.Open)
'Ensure the object is updated
'Force the full model to be created
MyObject = CType(serializer.Deserialize(fstFileStream), MyClass)
If Not fstFileStream Is Nothing Then
fstFileStream.Close()
fstFileStream = Nothing
End If
I am using the XmlSerializer class to deserialize a file, please see
attached code.
This works fine from a windows form, but fails when called from an asp.net
web service. Unfortuantely I can't get a proper error message, the browser
just a "this page cannot be displayed" message.
I have read that the account the service runs under requires write access to
the .net framework temp directory which it has.
Could anyone give me any pointers as to why this could be failing.
Many thanks for any suggestions,
Steve
Dim serializer As New XmlSerializer(GetType(MyClass))
Dim fstFileStream As FileStream
Dim MyObject As MyClass
'Deserialise the file to create the main web site object
serializer = New XmlSerializer(GetType(MyClass))
fstFileStream = New FileStream(Me.SerialiseFileName,
FileMode.Open)
'Ensure the object is updated
'Force the full model to be created
MyObject = CType(serializer.Deserialize(fstFileStream), MyClass)
If Not fstFileStream Is Nothing Then
fstFileStream.Close()
fstFileStream = Nothing
End If