New Posts New Posts RSS Feed: LoginAsync problem
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

LoginAsync problem

 Post Reply Post Reply
Author
tj62 View Drop Down
Groupie
Groupie
Avatar

Joined: 21-May-2009
Location: Iceland
Posts: 81
Post Options Post Options   Quote tj62 Quote  Post ReplyReply Direct Link To This Post Topic: LoginAsync problem
    Posted: 26-Aug-2009 at 4:09am
Hi, I'm writing my first silverlight app. with Ideablade. Please note that I'm using a valid DevForce Silverlight license.

If I call LoginAsync such:
 
var cred = new LoginCredential("demo","demo","demo");
_mgr.LoginAsync(cred, LoggedIn, null);
 
I get this exception in the LoggedIn receiver method:
 
The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://ideablade.com/EntityModel:credential. The InnerException message was 'XML 'Element' 'http://ideablade.com/EntityModel:credential' does not contain expected attribute 'http://schemas.microsoft.com/2003/10/Serialization/:Type'. The deserializer has no knowledge of which type to deserialize. Check that the type being serialized has the same contract as the type being deserialized.'.  Please see InnerException for more details.
 
However if I try logging in such :
 
_mgr.LoginAsync(cred, LoggedIn, null);
 
I get this exception in the LoggedIn recevier method:
This product is not registered or the key may no longer be valid.
Please contact your IdeaBlade representative to obtain a new key or email sales@ideablade.com.
Product: Error
 
My solution is setup as in the DevForce Dev. Guide and shown in the screenshot below:

 
The C2NetSilverWeb is the startup project, and C2NetSilver is the Silverlight Applicaton project.
I have succeessfully retrieved data etc. using a Console project as the client.
I'm a quite a newby in the security stuff, so I have note done anything to implement the security on the server site.
 
What could be the problem?

Regards
  TJ
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 26-Aug-2009 at 9:10am
If you've upgraded your license make sure that you also re-generate the domain model, by opening the Object Mapper and saving. 
 
Make sure that the C2NetDomainModelSL project is referenced by C2NetSilver, and that the app.config in C2NetSilver contains a <probeAssemblyName> containing the fully-qualified assembly name of the C2NetDomainModelSL. (The need for a project reference will be fixed in release 5.2.2.)
 
On the web side, make sure that the C2NetDomainModel project is referenced by C2NetSilverWeb and that the web.config contains a <probeAssemblyName> with the not fully qualified assembly name for C2NetDomainModel.  (Note that both the C2NetDomainModel and C2NetDomainModelSL projects should have the same assembly name.) 
 
In the web.config, also check that it contains a clientApplicationType="Silverlight" attribute on the ideablade.configuration element.
 
You can check out the "Separate Model Projects" Silverlight learning resource for a solution structure very similar to your own.
Back to Top
tj62 View Drop Down
Groupie
Groupie
Avatar

Joined: 21-May-2009
Location: Iceland
Posts: 81
Post Options Post Options   Quote tj62 Quote  Post ReplyReply Direct Link To This Post Posted: 27-Aug-2009 at 3:11am
The problem was that the  C2NetDomainModel project was not referenced by C2NetSilverWeb. After adding that reference everything worked as expected.
 
The other stuff I had already corrected by some "hacking". In particular it took me long time to find out that C2NetSilver should contain a <probeAssemblyName> containing the fully-qualified assembly name of the C2NetDomainModelSL. That is probably the hardest part to understand by newbys like me although having over 16 years programming experience.
 
Thank you.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down