|
|
||||||
|
#1
|
|
|
|
|
Hi,
I'm trying to add data to NEWS listing But, when I execute the code, it returns the following error: The request failed with HTTP status 401: Unauthorized I'm impersonating the user as administrator os SPS. Can someone help? HSH Ueslei |
|
|
|
#2
|
|
|
|
|
Lets take a look at the code.
|
|
#3
|
|
|
|
|
Thanks James!
I resolved the problem, the line objShare.Credentials = System.Net.CredentialCache.DefaultCredentials was missing in my code. But now I've other problem. When I execute the code, the error above is given. Exception of type Microsoft.SharePoint.SoapServer.SoapServerExceptio n was thrown. Can someone help? Any idea why the object is raising this error? Here is my code: Dim objShare As New barcelona.Lists objShare.Credentials = System.Net.CredentialCache.DefaultCredentials Dim strInsert As String = "<Method ID='1' Cmd='New'>" & _ "<Field Name='Title'>news about sps</Field>" & _ "<Field Name='Description'>descriptioin of news</Field>" & _ "<Field Name='Type'>5</Field>" & _ "<Field Name='HtmlBlob'>text in <b>HTML</b> format</Field>" & _ "</Method>" Dim xmlDoc As New System.Xml.XmlDocument Dim elemBatch As System.Xml.XmlElement = xmlDoc.CreateElement("Batch") elemBatch.SetAttribute("OnError", "Continue") elemBatch.SetAttribute("ListVersion", "1") elemBatch.SetAttribute("ViewName", "7674348d-352e-4952-8ebc-75392d98e55c") elemBatch.InnerXml = strInsert Try Dim ndRetorno As System.Xml.XmlNode = objShare.UpdateListItems("News", elemBatch) Response.Write(ndRetorno.OuterXml) Catch ex As Exception Response.Write(ex.Message) End Try Ueslei "James Edelen [MVP]" <jj4> wrote in message news:3644 [..] |
|
#4
|
|
|
|
|
Did you upgrade this server from beta 2 to the Tech refresh? If so, you
need to delete stssoap.dll from the GAC (c:\windows\assembly) on the server. Basically when you get a Soap Exception it means that the web service on the server returned an error. Also, I would try removing the elemBatch.SetAttribute("ViewName", "7674348d-352e-4952-8ebc-75392d98e55c") line. It looks like you just pulled this from the sample in the SDK. You really need to change all this information to use the actual viewname and GUID (which is a pain, and usually not needed). You may also want to check out my Lists Web Service article on MSD2D.com to maybe get a couple other pointers. |
|
#5
|
|
|
|
|
Hi James,
What I'm tring to add is a row in the NEWS area of my site. The default NEWS area created by Sharepoint. Do you have an idea of how can I figure out this problem? Waiting, Ueslei "James Edelen [MVP]" <jj4> wrote in message news:1132 [..] |
|
#6
|
|
|
|
|
I personally haven't tried adding items to the News section of the portal,
but I did write an article for adding items to the Announcements section (similar principles should apply I would think, except news is actually an area rather than a list, so you would have to add items to the Portal Listing lists in that area). I will take a look at this a little later as I eventually need to add news posting to my SharePointPlugin for newsgator and so now is as good a time as any to look into it. |
|
#7
|
|
|
|
|
Ok, the only reason for writing in News area of the portal is the fact that
News accepts pictures and links, while announcements dont. Any help would be appreciated. Ueslei "James Edelen [MVP]" <jj4> wrote in message news:2616 [..] |
|
#8
|
|
|
|
|
Could you post the link to the article regarding adding
an item to the Announcements section. We are trying to add an item to the Site Directory List and are running into the same error. >-----Original Message----- >I personally haven't tried adding items to the News section of the portal, >but I did write an article for adding items to the Announcements section >(similar principles should apply I would think, except news is actually an >area rather than a list, so you would have to add items to the Portal >Listing lists in that area). I will take a look at this a little later as I >eventually need to add news posting to my SharePointPlugin for newsgator and >so now is as good a time as any to look into it. > >-- >James Edelen >Microsoft MVP - SharePoint Portal Server >Microsoft MVP - Windows XP Media Center >Microsoft Associate Expert >Expert Zone - http://www.microsoft.com/windowsxp/expertzone >"Ueslei R. Valentini" <ueslei> wrote in message >news:a556 >> Hi James, >> What I'm tring to add is a row in the NEWS area of my site. The default >NEWS >> area created by Sharepoint. >> Do you have an idea of how can I figure out this problem? >> >> Waiting, >> Ueslei >> >> "James Edelen [MVP]" <jj4> wrote in message >> news:1132 >> > Did you upgrade this server from beta 2 to the Tech refresh? If so, you >> > need to delete stssoap.dll from the GAC (c:\windows\assembly) on the >> server. >> > >> > Basically when you get a Soap Exception it means that the web service on >> the >> > server returned an error. >> > >> > Also, I would try removing the elemBatch.SetAttribute ("ViewName", >> > "7674348d-352e-4952-8ebc-75392d98e55c") >> > line. It looks like you just pulled this from the sample in the SDK. >> You >> > really need to change all this information to use the actual viewname >and >> > GUID (which is a pain, and usually not needed). >> > >> > You may also want to check out my Lists Web Service article on MSD2D.com >> to >> > maybe get a couple other pointers. >> > >> > -- >> > James Edelen >> > Microsoft MVP - SharePoint Portal Server >> > Microsoft MVP - Windows XP Media Center >> > Microsoft Associate Expert >> > Expert Zone - http://www.microsoft.com/windowsxp/expertzone >> > "Ueslei R. Valentini" <ueslei> wrote in message >> > news:2516 >> > > Thanks James! >> > > I resolved the problem, the line >> > > objShare.Credentials = System.Net.CredentialCache.DefaultCredentials >> > > >> > > was missing in my code. >> > > But now I've other problem. >> > > When I execute the code, the error above is given. >> > > Exception of type Microsoft.SharePoint.SoapServer.SoapServerExceptio n >> was >> > > thrown. >> > > >> > > Can someone help? Any idea why the object is raising this error? >> > > Here is my code: >> > > Dim objShare As New barcelona.Lists >> > > >> > > objShare.Credentials = System.Net.CredentialCache.DefaultCredentials >> > > >> > > >> > > >> > > Dim strInsert As String = "<Method ID='1' Cmd='New'>" & _ >> > > >> > > "<Field Name='Title'>news about sps</Field>" & _ >> > > >> > > "<Field Name='Description'>descriptioin of news</Field>" & _ >> > > >> > > "<Field Name='Type'>5</Field>" & _ >> > > >> > > "<Field Name='HtmlBlob'>text in <b>HTML</b> format</Field>" & _ >> > > >> > > "</Method>" >> > > >> > > Dim xmlDoc As New System.Xml.XmlDocument >> > > >> > > Dim elemBatch As System.Xml.XmlElement = xmlDoc.CreateElement("Batch") >> > > >> > > elemBatch.SetAttribute("OnError", "Continue") >> > > >> > > elemBatch.SetAttribute("ListVersion", "1") >> > > >> > > elemBatch.SetAttribute("ViewName", >> "7674348d-352e-4952-8ebc-75392d98e55c") >> > > >> > > elemBatch.InnerXml = strInsert >> > > >> > > Try >> > > >> > > Dim ndRetorno As System.Xml.XmlNode = objShare.UpdateListItems("News", message >> > > news:3644 >> > > > Lets take a look at the code. >> > > > >> > > > -- >> > > > James Edelen >> > > > Microsoft MVP - SharePoint Portal Server >> > > > Microsoft MVP - Windows XP Media Center >> > > > Microsoft Associate Expert >> > > > Expert Zone - http://www.microsoft.com/windowsxp/expertzone >> > > > "Ueslei R. Valentini" <ueslei> wrote in message >> > > > news:1004 >> > > > > Hi, >> > > > > I'm trying to add data to NEWS listing >> > > > > But, when I execute the code, it returns the following error: [..] |
|
#9
|
|
|
|
|
#10
|
|
|
|
|
Hi James,
I didnt find anything related to Adding news listing data to an area... I need help...please. HSH Ueslei "James Edelen [MVP]" <jj4> wrote in message news:1544 [..] |
|
#11
|
|
|
|
|
That article doesn't have anything about adding news to an area. I posted
it because nick asked for a link to it and because it talks about how to use the list service in general. I didn't have time yesterday, but next time a get a few free development cycles, I will try to figure out how to post to the news list. I will let you know when I do. |
|
|
| Similar Threads | |
| The request failed with HTTP status 401: Unauthorized. Hello All, Could be regurgitating an old issue that I have been unable to find a solution but here goes... System Info: VM1 (Virtual Machine running on VMWare Server 1.0.8) -... |
|
| The request failed with HTTP status 401: Unauthorized. Dear MSDN! We are trying to get Reporting Services working. But we get following error: The request failed with HTTP status 401: Unauthorized. Something that i've... |
|
| The Request Failed with HTTP status 401 Unauthorized Hi, We have integrated our portal developed in ASP.NET 2.0 with MS CRM 3.0 using the web services exposed by CRM. We are able to insert the records successfully in Account... |
|
| The request failed with HTTP status 401: Unauthorized Scenario: Machine A: ASP.NET Web UI IIS 6.0 Windows Server 2003 Impersonation Account: domain\Acct1 Machine B: ASP.NET Web Service IIS 6.0 |
|
| The request failed with HTTP status 401: Unauthorized. Hello, I came in today and when we goto [..] It asks for a domain login and then we get "The request failed with HTTP status 401: Unauthorized." The security hasn't changed.... |
|
|
All times are GMT. The time now is 12:01 AM. | Privacy Policy
|