This answer assumes there is a good reason why ASP classic enters into the equation in the first place. Perhaps its because Silverlight is being introduced into an existing ASP site. The problem is that most Silverlight Client-Server examples involve .NET WCF on the server.
The answer to your problem is don't use a WCF service to fetch your session data. Use a simple ASP page instead. It should be fairly straight-forward to use a simple XML structure to carry the session data you want to the Silverlight app. Use a DTO class that can be used to deserialise the XML into a simple class. Something like this:
(Caveat: air code)
<%
Dim dom: Set dom = CreateObject("MSXML2.DOMDocument.3.0")
dom.loadXML "<SessionData />"
AddElem dom.documentElement, "ValueKey", Session("valuekey")
AddElem dom.documentElement, "SomeOtherValue", Session("othervalue")
''# include other session values needed by client here.
Response.ContentType = "text/xml"
Response.CharSet = "utf-8"
dom.save Response
Sub AddElem(parent, name, value)
Dim elem: Set elem = parent.ownerDocument.createElement(name)
parent.appendChild elem
elem.text = value;
End Sub
%>
In Silverlight:
[DataContract]
public class SessionData
{
[DataMember(Order=1)]
public string ValueKey {get; set; }
[DataMember(Order=2)]
public string SomeOtherValue {get; set; }
public static void Fetch(Action<string> returnResult, Action<exception> fail)
{
WebClient client = new WebClient();
OpenReadCompletedEventHandler eh = null;
eh = (s, args) =>
{
try
{
var sr = new DataControlSerializer(typeof(SessionData));
returnResult((SessionData)sr.ReadObject(args.Result));
}
catch (Exception e)
{
fail(e);
}
finally
{
client.OpenReadAsyncCompleted -= eh;
}
};
client.OpenReadAsyncCompleted += eh;
client.OpenReadAsync(new Uri("../serviceFolder/sessionState.asp", UriKind.Relative));
}
}
Now in some UI or ViewModel you do
void SessionData_Available(SessionData sessionData)
{
_sessionData = sessionData;
// Other actions needed once session data has arrived.
}
void ReportProblem(Exception e)
{
// Some UI change to inform user of failed fetch
}
...
SessionData.Fetch(SessionData_Available, ReportProblem);