Recently selected to do an MS event to demonstrate the power of WSS /MOSS and Office and all its possibilities I decided to come up with a scenario that migh better demonstrate the available functionality related to integration cross platform. This also enables Enterprise Architects to consider the of Office Application to develop solutions. We have to be realistic and accept the fact that most Information Workers would much rather use Outlook, Word or Excel as their application of choice over the one that has been created from scratch by the application development team. Main reasons being the information from the application will eventually end up in one of these applications, and the user is comfortable and fimiliar with the UI.
So all that aside, my solution (the one I have in mind anayway) will do the following.
- Maintain Data(customer info and some hypothetical drug names) in WSS lists. Reason for this is the ability to maintain versions.
- Have Content Types in WSS, these templates when opened in Word can use data from various sources including above.
- Create an Actions Pane in Word to get data in and out of the storage locations.
- One of the storage locations will be WSS.
The way I have approached this is to understand what the webservices are and what the return. Working with Virtual PC has some challenges and since I do this frequently I have created a class that would do this kind of thing for me.
Before we use this class we require a web refence and before we ca create that an unserstanding of the web services is reuired. The following SDK contains a CHM that describes the services and where the can be accessed.
Windows SharePoint Services 3.0: Software Development Kit
Having looked at this a created web Reference using Visual Studio:
The service I intend to use is the Lists service located at the following location
http://192.168.150.1:33928/_vti_bin/lists.asmx?wsdl (This is on a Virtual PC using the Loopback Adapter) to install this on vista see my previous post.
If you are using a subsite the URL changes to reflect the subsite http://192.168.150.1:33928/{your subsite}_vti_bin/lists.asmx?wsdl

Follow the wizard completing the name of the web reference(If you want to use the sample code name it Web_Reference)
Retrieving the Data
Create a small windows app to call the webservice and save the xml to a file.
test.xml (11.59 KB)
I enjoy working with XML , however I find it tough going when you have large files with data you need to extract. I'm taking the lazy way out and create a class that i could use to both Serialize and Deserialize as I move my solution forward. This is done in a few aimple steps.
- Use the XML and create a Schema from it
- use the Schema to auto generate a class from it(you can choose a dataset, but they are overkill for what I'm planning)
Create Schema and Class
You can do it using xsd.exe
OR
Use Visual Studio, open the xml file and select the schema view

Save the .XSD file and use XSD.EXE to create a class from it.
test.xsd (4.56 KB)
"xsd c:\test.xsd /classes /language:cs /namespace:PeterVerster.Demo.Office /outputdir:c:\"
The above command using the xsd file generate the following output.
Thats how far I got for now, Part 2 will address:
- How to make the collection a bit better using Predicates.
- Create some Utility Methods to Serialize and Deserialize
- Find the detail we are intersted in...
Good Luck
PS: I realised the .cs files are blocked by my provider. I'll upload the complete solution in Part II
Classes_and_Utils.zip (7.14 KB)