.Background
I want to use the session in sliverlight, so I create wcf set Session and get Session.
why use the wcf operate the session? because the sliverlight don't support the session .
.phenomenon
I create the wcf
1)add the" <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>" in web.config.
2) modify the services class " [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]"
3)add namespace "System.web" to project. Now you can use the httpcontext.current.seesion .
4) I add two method in service class (getSession and setSession) , code is here:
when I call login function ,I will save the member data to the session. this logic is right.
but another page getSession that throw the "The remote server returned an error: NotFound".
I am so grief, I search the resources that explain the server side or client side have error setting.
I think this error it is the client side don't know what type return. because I return object don't member data.
but I set the session is member data.
.solution
I modify the getSession function return the member data ,this problem have fixed.
why the wcf don't know convert the object to member ? my function cann't hardcode member type.
I think use the serviceknowtype will fix this problem ,so I try is ok.