Geeks With Blogs
Fringe SharePoint Continued
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 Posted on Friday, July 31, 2009 9:45 AM SharePoint | Back to top


Comments on this post: Why Blog and Reference Code that does no Work??

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © juanlarios | Powered by: GeeksWithBlogs.net