Fringe SharePoint Continued
Site Sections
Home
Contact
Syndication
Login
Posts
42
Comments
19
Trackbacks
0
<< Linking Documents in SharePoint 2007
|
Home
|
Unexpected WCF web Service Behaviour >>
Why Blog and Reference Code that does no Work??
In the last week, I have been working on a project that involves web services. It has been an interesting project, SharePoint projects are always a surprise in that code is supposed to work a certain way and it never really seems to work the way it's supposed to.
I feel as though i need to apologize for this post because it's kind of a rant. I still feel like it needs to be said. If someone out there is going to blog please post up code that is your own! and more importantly post up code that actually works!!!I We can't seem to do a whole lot about msdn, it appears they are always going to post up bad code. Do take MSDN code with a grain of salt, it will point you in the right direction but in my experience I have found only 10% of the code posted there actually works as is!
My example is from thsi MSDN blog
post
. It seems as though every blog post I read referenced this post. I'm not going to posts links to those other blogs. The sad thing was that They actually cut paste this code and posted it as their own. No reference to the MSDN post. And it seems as thought they did not even run the code cause it realy does not work.
Issues with this code:
1) the webID that is supposed to be the last input paramater, cannot be blank. Some people have been reporting this issue. I personally did not have this issue, but I was using WCF not a web service code.
2) I don't know if this is because I used WCF but the input variables are not XmlNode they are XmlElements. My code does not even compile with the posted code. Why is there no documentaion on Msdn about thsi? It is minor but it's a change in the object model, and input variables that deserves some documentation.
3) The Query string is nto complete, Msdn does not claim to have this finished. It is more of a template for the CAML querey. I guess I was just frustrated because a web service call would just throw an exception and would not return any helpful message about what was wrong with the call. It turns out it was my CAML query.
4) Once I got the web service call working with basically blank XmlElements. I was able to add xml that I wanted to incorporate. The QueryOptions xml, is set to not return mandatory fields, yet it seems to return extra fields.
5) The ViewFields is quite confusing, one thing to keep in mind with the view fields is that it does not refer to the "Display Name" of the columns. This is important not only to viewfields, but to the Query as well. My suggestion is to download a
CAML
tool. Build your query first and then cut paste it from the generated CAML in the tool.
After my battling I friend of mine found this
post
, wich was exactly what I was doing. And at the very least, it had working code!!! Please don't regurgitate code that is not yours withouth any reference, and don't post up code that does not work!
Juan
Share This Post:
posted on Friday, July 31, 2009 9:45 AM
Print
Comments
No comments posted yet.
Post Comment
Title
*
Name
*
Email
Url
Comment
*
Remember Me?
Enter the code shown above
Archives
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
I'm home! (@ Winnipeg International Airport (YWG) w/ 2 others)
http://t.co/I1WdEhev
about 2 days ago
juan_larios
I am so tired, hopefully attendees
@CloudFest
got something out of my session. Sitting in on a
#socialmedia
session.
about 2 days ago
juan_larios
Heading to Denver for
@cloudfest
#sharepoint
! (@ Winnipeg International Airport (YWG))
http://t.co/RPWAeWBs
about 2 days ago
juan_larios
@J_Selph22
quit your whining!
about 5 days ago
juan_larios
I hate the
#giants
!!! Why do they have to make a miracle catch every time!!!
about 6 days ago
juan_larios
I'm at The Grove Pub & Restaurant (164 Stafford St, Winnipeg)
http://t.co/XqDJh1yA
about 9 days ago
juan_larios
@shantzontech
very funny...and also very funny
about 38 days ago
juan_larios
Annoyed at
@WestJet
for loosing luggage and not calling me back for 2 days, calling the number I was given and it is a general ans machine
about 38 days ago
juan_larios
Word to the wise, when trying out a new recipe on salmon sent from Alaska do not add more chili powder than the recipe calls for
about 40 days ago
juan_larios
WOW! I am so excited for this!
http://t.co/n3q20oCn
about 40 days ago
Copyright © 2005 juanlarios
This work is licensed under a
Creative Commons License