Webservice function not working

rated by 0 users
This post has 13 Replies | 2 Followers

Top 500 Contributor
Posts 55
Points 850
PKnopf Posted: Tue, May 13 2008 4:48 AM

Unable to deserialize object from response body of type CommunityServer.WebServices.Serialization.Common.ActivityMessageSerialized

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Unable to deserialize object from response body of type CommunityServer.WebServices.Serialization.Common.ActivityMessageSerialized

Source Error:

 
Line 6:          Public Shared Sub AddedQuoteMessage(ByRef quote As Quote)
Line 7:              Dim service As New CommunityServer.WebServices.Membership.MembershipService("http://www.spiritopedia.com", "secret", "secret")
Line 8:              service.AddUserActivityMessage("body", "NewForumPost", UserHelper.GetCSUserID(quote.AddedByName))
Line 9:          End Sub

Source File: C:\Users\Paul\Documents\Visual Studio 2008\Projects\Spirit.Quotes\Spirit.Quotes\BLL\ActivityMessages.vb    Line: 8

Stack Trace:

[NullReferenceException: Unable to deserialize object from response body of type CommunityServer.WebServices.Serialization.Common.ActivityMessageSerialized]
   CommunityServer.WebServices.Serialization.Common.Response.GetResponseObject() +222
   CommunityServer.WebServices.Membership.MembershipService.AddUserActivityMessage(ActivityMessage message, Int32 userId) +211
   CommunityServer.WebServices.Membership.MembershipService.AddUserActivityMessage(String body, String type, Int32 userId) +66
   Spirit.Quotes.BLL.ActivityMessages.AddedQuoteMessage(Quote& quote) in C:\Users\Paul\Documents\Visual Studio 2008\Projects\Spirit.Quotes\Spirit.Quotes\BLL\ActivityMessages.vb:8
   Spirit.Quotes.BLL.QuotesCL.AddQuote(Quote& quote) in C:\Users\Paul\Documents\Visual Studio 2008\Projects\Spirit.Quotes\Spirit.Quotes\BLL\QuotesCL.vb:33
   ASP.addnew_aspx.btnAddQUote_Click(Object sender, EventArgs e) in C:\Users\Paul\Documents\Visual Studio 2008\Projects\Spirit.Quotes\Web\addnew.aspx:36
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

 

 

  • | Post Points: 20
Top 10 Contributor
Posts 5,284
Points 49,020
CS Developers

Are you using the CommunityServer.WebServices.dll from the RTM download?  If so, we released an update two weeks ago on our API site and one of the fixes included addressed an issue with adding site activity messages.  You can get the updated DLL here:  http://api.communityserver.org/download/

  • | Post Points: 20
Top 500 Contributor
Posts 55
Points 850
PKnopf replied on Tue, May 13 2008 3:58 PM

 Now i'm getting this error. This time, the error is happening upon creation of the service. Not the adding of the activity message.

Server Error in '/Web' Application.

Unable to deserialize object from response body of type CommunityServer.WebServices.Serialization.Membership.ApiKeyListSerialized

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Unable to deserialize object from response body of type CommunityServer.WebServices.Serialization.Membership.ApiKeyListSerialized

Source Error:

 Public Class ActivityMessages
Line 6:          Public Shared Sub AddedQuoteMessage(ByRef quote As Quote)
Line 7:              Dim service As New CommunityServer.WebServices.Membership.MembershipService("http://www.spiritopedia.com", "XXXXX", "XXXXX")
Line 8:              Dim message As New ActivityMessage
Line 9:              message.Body = "body"

Source File: C:\Users\Paul\Documents\Visual Studio 2008\Projects\Spirit.Quotes\Spirit.Quotes\BLL\ActivityMessages.vb    Line: 7

Stack Trace:

 [NullReferenceException: Unable to deserialize object from response body of type CommunityServer.WebServices.Serialization.Membership.ApiKeyListSerialized]
   CommunityServer.WebServices.Serialization.Common.Response.GetResponseObject() +222
   CommunityServer.WebServices.Common.BaseService.ValidateUserApiKey(String username, String apiKey) +129
   CommunityServer.WebServices.Common.BaseService..ctor(String siteUrl, String username, String apiKey) +477
   CommunityServer.WebServices.Membership.MembershipService..ctor(String siteUrl, String username, String apiKey) +37
   Spirit.Quotes.BLL.ActivityMessages.AddedQuoteMessage(Quote& quote) in C:\Users\Paul\Documents\Visual Studio 2008\Projects\Spirit.Quotes\Spirit.Quotes\BLL\ActivityMessages.vb:7
   Spirit.Quotes.BLL.QuotesCL.AddQuote(Quote& quote) in C:\Users\Paul\Documents\Visual Studio 2008\Projects\Spirit.Quotes\Spirit.Quotes\BLL\QuotesCL.vb:33
   ASP.addnew_aspx.btnAddQUote_Click(Object sender, EventArgs e) in C:\Users\Paul\Documents\Visual Studio 2008\Projects\Spirit.Quotes\Web\addnew.aspx:36
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746

Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

 


  • | Post Points: 20
Top 10 Contributor
Posts 5,284
Points 49,020
CS Developers

Try hitting the webservice directly through your browser.  You are missing a DLL:

http://spiritopedia.com/api/membership.ashx

Had you uploaded the newer WebServices DLL to the website?  If so, that was not necessary.  The updated DLL is only needed on the client side, not on the server site.

  • | Post Points: 20
Top 500 Contributor
Posts 55
Points 850
PKnopf replied on Wed, May 14 2008 1:55 PM

 Ok, the serverside error is fixed. My api (on server side) is working. I am using the update DLL only on the clientside. I still get an error. Same as the first error I got...

Unable to deserialize object from response body of type CommunityServer.WebServices.Serialization.Common.ActivityMessageSerialized

I hope I can get this resolved.

Thanks for your help!

  • | Post Points: 5
Top 500 Contributor
Posts 55
Points 850
PKnopf replied on Thu, May 15 2008 3:14 AM

 Maybe I can package up my solution and let you take a look at it?

  • | Post Points: 20
Top 10 Contributor
Posts 5,284
Points 49,020
CS Developers

Sorry for the delay.

I think that might be best.  One key thing might be getting your DB.  I've tried replicating it locally, but it is working fine.

  • | Post Points: 20
Top 500 Contributor
Posts 55
Points 850
PKnopf replied on Sat, May 17 2008 6:17 AM

I've sent a link to the project in a message to you.

Thanks!

  • | Post Points: 5
Top 500 Contributor
Posts 55
Points 850
PKnopf replied on Sun, May 18 2008 1:35 PM

 I have create a simple console app to try to use the adduseractivitymessage out of the solutions context.

Sub Main()

Dim service As New CommunityServer.WebServices.Membership.MembershipService("http://www.spiritopedia.com", "****", "****")

service.AddUserActivityMessage("body", "NewForum", 2100)

End Sub

I am using the updated assembly from the api.communitysever.com

maybe I can give you access to my production database?

  • | Post Points: 20
Top 10 Contributor
Posts 5,284
Points 49,020
CS Developers

Did your console app work, or did it also throw the error?

I got the stuff you had sent me last week and will be looking at it today.

  • | Post Points: 20
Top 500 Contributor
Posts 55
Points 850
PKnopf replied on Mon, May 19 2008 12:18 PM

 oops, I forgot to metion that it did also throw the error.

I'm going to package up the console app and send that to you so you dont have to do all that installing of my application.

  • | Post Points: 5
Top 500 Contributor
Posts 55
Points 850
PKnopf replied on Mon, May 19 2008 12:30 PM

 I sent you a link to download the console app.

Thanks for your help!

  • | Post Points: 5
Top 500 Contributor
Posts 55
Points 850
PKnopf replied on Tue, May 20 2008 9:29 AM

 When you said you tried it locally, did you use my website and my api key?

Maybe you could try to do the samething I'm trying to do, but using my website and credentials. (they are in the solution I send you).

I don't mind if you add fake activity messages to my site. I'll just delete them later.

  • | Post Points: 5
Top 500 Contributor
Posts 55
Points 850
PKnopf replied on Wed, May 21 2008 4:47 PM

Any update on this?

What I think I'm going to do is reinstall the CS and add all my add-ons (which have nothing to do with core), and if that don't work, it must be the database.

How should I go about redoing/reinstall my database? The things is I want to save all the community content on it.

  • | Post Points: 5
Page 1 of 1 (14 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com