473,473 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Infopath docs

I have a question regarding Infopath and Sharepoint. We have a
sharepoint site set up with a few Infopath document libraries, how can
I open,modify, and save the Infopath documents stored therein?

Currently I have the following:

XmlDocument doc = new XmlDocument();
doc.Load("http://bomserver2:74/TestSharePoint/Library/0000.xml");

The Sharepoint site is returning a (401) Unathorized error when loading
the document. Of course I could set the Sharepoint site to allow
anonymous access to these libraries but that may not be the desired
solution. So I guess more specifically I need to know how to
propmatically specify user credentials when loading/saving xml
documents to Sharepoint. Hope I explained that thoroughly enough for
someone to be able to provide some help. Thanks

Sep 21 '06 #1
1 1586
I found the answer to my own question. I will post it here so others
who may be searching for this kind of info can find it.

loading the XML data:

XmlDocument doc = new XmlDocument();
HttpWebRequest req = (HttpWebRequest)WebRequest.
Create("http://bomserver2:74/TestSharePoint/Library/0000.xml");

req.Credentials = CredentialCache.DefaultNetworkCredentials;
Stream s = req.GetResponse().GetResponseStream();
XmlTextReader reader = new XmlTextReader(s);
doc.Load(reader);

// you now have an XML document that you can do with as you please
//saving the XML document back at the share point site requires
//installation of a custom web service however ... see
//http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_sp2003_ta/html/odc_writingcustomwebservicesforsppt.asp
//
// After installing the sample web service and adding the web
//reference to your project one should be able to utillize
//the UploadDocument service after converting the
//XML contents into a byte array

string result = customService.UploadDocument("a.xml", byteArray,
"http://bomserver2:74/TestSharePoint/Library");
MessageBox.Show(result);

Sep 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sven Steinacker | last post by:
Hi, XSLT files generated by Microsoft InfoPath applied to an applicable XML file produces quite decent HTML presentations. At least with Mozilla and, of course, IE 6.0 the results look the same...
0
by: Dr. Paul Caesar - CoullByte (UK) Limited | last post by:
Hi all, Have been playing about with web services but unable to achieve what I am wanting and in attempts finding strange problems. I have created a web service for retrieving customer data...
0
by: Pascal Brunot | last post by:
Hi, Running XSDObjectGen (1.4.1.0) on the following Infopath-generated XSD gives an "unexpected error": "Event register full" during generation (exact english error message may differ, i am...
4
by: MJ | last post by:
A question for InfoPath and ASP.NET experts: What do you think about the future of InfoPath and ASP.NET WebForms? Is InfoPath 12 going to replace ASP.NET WebForms? If not, in which types of...
0
by: Cosimo Galasso | last post by:
I'm building a aspx web page with a button control. When the button is clicked the server build an xml string containg the directive to be opened with infopath. When the client receive the file an...
3
by: Jeff Richardson | last post by:
This is a repost from the InfoPath news group. Hi, I am writing a SharePoint application that works with InfoPath forms. When a user submits a completed InfoPath form to a forms library my code...
0
by: Sebastian Gingter | last post by:
I have an infopath XML file and want to use XPath queries with the XmlDocument object. The Problem: Every (in my eyes correct) XPath query does return a NULL object. Example: XmlDocument doc =...
0
by: =?Utf-8?B?Q2hhcmxlcyBTaW1wc29u?= | last post by:
Hello I've tried in the InfoPath groups but no luck yet. Here is my situation: All computers are on an Active Directory domain in the company. I have an Infopath form stored on the network...
0
by: Anni | last post by:
Hi, Can anyone please tell me how do I give same namespace for different infopath forms.? I have an XML formed by an infopath form, the XML is : <?mso-infoPathSolution...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.