Question

I'm using the UGC web service to return UGC content but I have an issue in that users are being returned as null. The users are being entered into the UGC database - I can see users in both the UGC_USERS table and the UGC_ITEMS tables but when it comes to retrieving the comments using the odata.svc the user is coming back as null.

WebServiceClient ugcCall2 = new WebServiceClient();
Uri uri = new Uri("http://new.ugc.service/odata.svc");
CDS.ContentDeliveryService cds = new CDS.ContentDeliveryService(uri);
var comments = client.Comments;

Does anyone know why this would be the case? Audience Manager isn't plumbed in at this point. We're simply adding comments from a domain user - the username is appearing in the UGC database but the user is coming back as null when we retrieve the comments from odata.

Thanks

John

Was it helpful?

Solution

John,

Make sure you're using the Expand method in your calls:

client.Comments.Expand("User")

This will ensure the full User data is also part of the results.

You can see it clearly if you query Odata directly:

odata.svc/Comments?$expand=User

Cheers

OTHER TIPS

It seems like a case of mis(-un)configured Ambient Data Framework (ADF). Make sure ADF is configured on your website -- that is the server from where you are making the call to the OData service.

ADF is responsible with sending your client information (e.g. user id, cookies, session id, etc) from a machine to another. It seems like in your case the communication to OData is done without this information. This points to an ADF not being configured properly. Check again the documentation of UGC on how to configured it.

BTW, your example code is not very clear, what it client ?

As Mihai said, make sure that the UGC ambient cartridge is configured on both the UGC CD Webservice as the (staging or live) website. If this is not done users will be registered with ID null.

Also see my blog for more common issues when installing UGC:

http://80000ft.blogspot.nl/2012/08/common-issues-while-installing-ugc.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top