Remotely access info path field in SharePoint 2007 - web-services

I have sharepoint document library which contains infopath files, however I want to write a c# console program to read a field of infopath file, from a client machine, via sharepoint web service.
how do i do that? I am not allowed to deploy any code to sharepoint server.

Couple steps involved.
1. Get the infopath file from the Sharepoint server using webservices. You most likely will use GetListItems to find the name/URL of the file and then you can use a webclient class to stream the file.
2. Once you have the file locally (in memory) you can read any infopath using the standard XMLReader class methods.
Shouldn't be terribly complicated but does involve a few different technologies (web services, web client, XML).

One other option would be to promote the field from the form into the SharePoint library (providing it is not a field in a repeating section or a rich text field) and then use the lists web service (http://mysite/_vti_bin/lists.asmx) to find your record and read the promited fields value from the returned results in web services.
Here is a link that will hopefully help you wish the lists.asmx web service (if you need it): http://msdn.microsoft.com/en-us/library/lists.lists.getlistitems(v=office.12).aspx
Hope this helps

Related

InfoPath call web service locally

I've created a C# Class Library with common classes I'm going to use in all my forms.
I've signed the assembly and added [assembly: AllowPartiallyTrustedCallers] to AssemblyInfo.cs.
I've created a Web Reference to the List sharepoint service in order to call GetListItems since I didn't manage to call it using InfoPath's DataConnection.
Then I've added a reference to my assembly from a Form Template project from VSTA.
After I publish this form to SharePoint and then open a new form from sharepoint using infopath client the web service call works fine.
But if I try to preview the form locally by running it from VSTA I get a security exception telling me it's can't get System.Net.WebPermission.
Now, I guess it works from the published form because it accesses the same sharepoint server as the one where the form is stored.
My question is whether it's possible to also make it work when I preview it locally? It would make my development cycle much shorter (don't have to publish the form each time).
Thanks,
Michael
I found a workaround which enables me to develop and debug easily. While developing I set the form trust level to Full Trust. Before deploying to Sharepoint I change the trust level back to normal.

Inconsistent PDF URLs returned from SharePoint query web service

I'm searching a SharePoint server through web services. When the web services return Word/Excel/PowerPoint documents, they contain links to the actual files, e.g. http://server/site/mydoc.doc. When the web services return PDF documents, they contain links to pages that link to the PDF document, e.g. http://server/site/DispForm.aspx?ID=1 which would contain a link to http://server/site/mydoc.pdf. I've tried _vti_bin/search.asmx with actions Query and QueryEx with no luck. What is the best way to get a link to the actual document so my app can download it?
Unfortunately, I'm using a large, shared SharePoint installation, and it's very unlikely that the server configuration can be changed.
You need the PDF IFilter installed on the server in order for the crawl to recognize PDF files and index them correctly. Here are some instructions from Adobe (PDF warning!) as well.

asp.net sharepoint development

Im my current project we need to interface with sharepoint to store and retrieve various documents.
This has previously been done by referencing the Microsoft.Sharepoint dlls directly and going from there. As I don't know a lot about sharepoint yet I have been doing some research.
Most of the examples I find actually refer to using the Sharepoint web services themselves (the various vti_bin ones shown in http://www.sharepointmonitor.com/2007/01/sharepoint-web-service/).
I cant seem to find the differences in approaches. This current project was written a few years ago so maybe the web services weren't available then?
I'm looking for a solution to add and retrieve data from sharepoint and also a little explanation as to the differences in using refernces vs the web service
Cheers
Referincing Microsoft.SharePoint.DLL is only supported on code that runs within SharePoint. It often does work on Projects that are not part of SharePoint but that are run on a SharePoint server, but that's a) unsupported and b) not all functions work. If your Applications runs outside of the SharePoint server, referencing Microsoft.SharePoint.dll won't work.
If you want to access SharePoint from an application outside of SharePoint, there's three ways:
Use the SharePoint Webservices, for example Lists.asmx
If your SharePoint site runs on SharePoint 2010, use one of the three Client Object Models (.net, Silverlight, JavaScript)
Develop some code that runs on the SharePoint Server and exposes the data through a Web Service. This only makes sense if you have to do something that's either complicated/painful to do entirely client side or if you really need full control over the web service.

Sharepoint Web Services Tutorial

I'm trying to upload documents to SharePoint using web services attaching custom metadata to the files. I've searched but have not found a good tutorial covering all these topics. Can anybody point me in the right direction?
Here's why I think I need to use web services:
I'm developing on XP and the Sharepoint object model is not remotable. This means any code which has "using Microsoft.Sharepoint" is out :-(
I'm looked into the CopyIntoItems web service but am having trouble implementing it myself. I was hoping for a clear tutorial. I've tried using the sample code from http://msdn.microsoft.com/en-us/library/copy.copy.copyintoitems.aspx , but I'm not sure what my sourceURL should be. Also, since I can't use "Microsoft.Sharepoint" references, I'm wondering what my Fields will look like? (Is this my metadata?) Also, I'm curious as to why only Website projects allow me to add a web service.
Once the file is "in" Sharepoint using that web service, I'll have to use another one to update custom columns, or metadata. Some of these are freeform text, but other must match entries in lists or lookups. I haven't found any information on this yet.
Thank you for your help!
Here is some code http://geek.hubkey.com/2007/10/upload-file-to-sharepoint-document.html
As for why it is that is the way because Microsoft wrote it that way :). Some people have written custom web services that combine them, http://www.sharepointblogs.com/ssa/archive/2006/11/30/wsuploadservice-web-service-for-uploading-documents-into-sharepoint.aspx
Using the built in web services you have to upload the file and upload CAML which contains the columns. Another option if you are using a MS-Office document is to make sure the author fills in the properties in the document then you can have those fields displayed in sharepoint.
Here is some stuff on the Sharepoint Designer - http://office.microsoft.com/en-us/sharepointdesigner/FX100487631033.aspx
Hope that helps a little.
You can link to the Sharepoint 2007 training from here: http://office.microsoft.com/en-us/training/HA102358581033.aspx
The designer I believe has a WS example in it.

Sharepoint web services to edit existing list from desktop

Perhaps I am not asking or searching for this correctly:
I want to have a desktop script (currently using python) that will update a list on a sharepoint site.
The current script reads various file shares, ftp sites and a ArcGIS database to determine which metadata files have been updated and published. The script then writes all these results to a Excel spreadsheet.
We would like to do the same thing, but keep the data in a Share Point list instead of a spreadsheet. We don't need to upload any files (which is what I keep running across in my search) but just update or add to a list.
We could care less about what language or tools we use, we just don't have access to any custom coding on the Share Point server.
You should be able to use the lists webservice on the Sharepoint server,
the url is normally:
http://host/sitename/_vti_bin/lists.asmx
you are looking at the UpdateListItems webservice call. I don't know python but I use C# and work with sharepoint every day you can find a working example on MSDN on a Windows app to call the web service.