Deliver Awesome UI with the most complete toolboxes for .NET, Web and Mobile development
Automate UI, load and performance testing for web, desktop and mobile
A complete cloud platform for an app or your entire digital business
Detect and predict anomalies by automating machine learning to achieve higher asset uptime and maximized yield
Automate decision processes with a no-code business rules engine
Optimize data integration with high-performance connectivity
Connect to any cloud or on-premises data source using a standard interface
Build engaging multi-channel web and digital experiences with intuitive web content management
Personalize and optimize the customer experience across digital touchpoints
Build, protect and deploy apps across any platform and mobile device
Rapidly develop, manage and deploy business apps, delivered as SaaS in the cloud
I have been assigned the task of researching the feasibility of using SiteFinity as a CMS for our current site's marketing department. I am testing things with the sample code I received from:
When I run the code and give it the login information I get a 401 Unauthorized error.
This is running with IISExpress.
How do I get around this?
Thanks for the updated code, but I see some problems with the sample code you recently provided.
1. It does not actually validate that the authentication was successful:
private void Login_button_Click(object sender, EventArgs e)
//set the credentials
string sfUrl = this.url.Text;
string username = this.username.Text;
string password = this.password.Text;
helper.SignIn(username, password, sfUrl);
The above simply makes the auth request and then enables the other buttons.
2. I do not think auth is working STILL because when I click the button "List data" I get an error:
An unhandled exception of type 'System.Runtime.Serialization.SerializationException' occurred in System.Runtime.Serialization.dll
This code causes that error: NewsItems rolesData = (NewsItems)rolesSerializer.ReadObject(ms);
It appears that the object is empty which means auth failed.
I am going to try a few things, but do you have any further tips?
OK, so I can see that authentication works when I click the LOGIN on the sample application. However, what I have a problem with now is when I click on the button labelled "LIST DATA" I get an exception. Here is the code:
private void ListNewsButtonClick(object sender, EventArgs e)
//Listing the roles
string rolesResult = null;
helper.CallService(ServiceHelper.NewsUrl, null, "GET", out rolesResult, "application/json");
using (MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(rolesResult)))
DataContractJsonSerializer rolesSerializer = new DataContractJsonSerializer(typeof(NewsItems));
NewsItems rolesData = (NewsItems)rolesSerializer.ReadObject(ms); <--- this line causes a n exception
foreach (NewsItem item in rolesData.Items)
The execption is system.runtime.serialization.serializationexception
How do I get over this hurdle?