Fringe SharePoint Continued
Site Sections
Home
Contact
Syndication
Login
Posts
48
Comments
32
Trackbacks
0
<< Why Blog and Reference Code that does no Work??
|
Home
|
Extending SharePoint: Checking if a List exists (Web Services) >>
Unexpected WCF web Service Behaviour
I am currently on a project that consists of an integration between a web application and SharePoint. Both applications live in their own servers and so it was necessary to use web services. I have come to many weird glitches and many unresolved issues at this time, I will make an effort to document as much as possible to save people time when working with WCF, SharePoint Web Services, and Visual Studio 2008.0
The first issue I'm going to write about is fairly easy to identify but it was frustrating dealing with.
The code that I wrote looked something like this:
_service.UpdateList(listID, GetDocLibNameChange(newListName),null, null, null, listVersion);
The _service is the ListSoapClient that I have access to through WCF. I simply update the name of the document library to something else. I feel I should post the code for the update XmlElement, there is detailed information and documentation on updating just about everything about a document library. This scenario was real simple, I only needed the ability to change the document library name. This is the code for the GetDocLibNameChange() method that puts together that XmlElement:
private XmlElement GetDocLibNameChange(string newName)
{
var xmlDoc = new XmlDocument();
var elBatch = xmlDoc.CreateElement("List");
elBatch.SetAttribute("Title", newName);
return elBatch;
}
That's it! Almost, I was getting a weird outcome where when I executed the UpdateList web service method I was getting an exception. Of course the exeption was a generic SOAP Exception, which I could not make tails of, and really couldn't because there was not much more than just Soap Exception. It turns out that the Update was still occuring!! So, update worked but exception was coming back!
SOLUTION:
If you read
MSND
page on this method, it specifies that the ListID is really a string of the list guid: "{GUID}". It turns out I got careless and was just passing in the list name. Note to self, pass in the expected paramaters!!! I felt like bloggint this to show 2 things:
1) The update still occured even with the excpetion.
2) How useless the soap exception messages and stack trace really are!
Happy Coding!
Juan
Share This Post:
Short Url:
http://wblo.gs/Yua
posted on Wednesday, August 19, 2009 5:17 PM
Print
Comments
No comments posted yet.
Post Comment
Title
*
Name
*
Email
Url
Comment
*
Remember Me?
Enter the code shown above
Archives
March, 2012 (3)
February, 2012 (3)
August, 2011 (2)
July, 2011 (1)
June, 2011 (1)
May, 2011 (2)
April, 2011 (2)
March, 2011 (2)
January, 2011 (1)
December, 2010 (1)
November, 2010 (3)
October, 2010 (4)
August, 2010 (1)
June, 2010 (1)
May, 2010 (1)
April, 2010 (1)
March, 2010 (2)
February, 2010 (2)
January, 2010 (2)
December, 2009 (1)
November, 2009 (3)
September, 2009 (2)
August, 2009 (3)
July, 2009 (4)
Post Categories
SharePoint
TFS
Development
Web Parts
Workflow
ALM
SharePointUserGroup
BUGS
Twitter
juan_larios
Headed to the first training session of my professional career! Although I will be working during the sessions
http://t.co/miYzvPHs
about 5 days ago
juan_larios
"is that Brandy? She's not dead?" -
@RuddyWine
about 6 days ago
juan_larios
Wasted half the day today catching up on all my favorite tv shows. Much needed down time!
about 7 days ago
juan_larios
Late night…working, wish the day had 35 hours.
about 10 days ago
juan_larios
Did you know, when developing
#SharePoint
Workflows in VS2010 the Event Receiver of feature receiver interferes with the workflow receiver?
about 10 days ago
juan_larios
http://t.co/9jDDpF4W
There are a couple of things you can do to optimize this. First, you have two Round trips in this call. Since you...
about 10 days ago
juan_larios
What a busy week! Glad it's the weekend and I can refresh.
about 22 days ago
juan_larios
I'm at Mulligans Restaraunt
http://t.co/c2HJQGuy
about 22 days ago
juan_larios
@robertregnier
I'm coming after you! I'm still getting used to the game! but getting closer and closer! I need re-string my raquet now!
about 30 days ago
juan_larios
@edblankenship
@TFService
Thanks Ed. I wasn't aware of this but I suspected. Just wanted to check with the master!
about 30 days ago
Tag Cloud
cloud computing
SharePoint 2007
SP 2010
visual studio 2008
Copyright © 2005 juanlarios
This work is licensed under a
Creative Commons License