473,770 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to provide credentials for writing mxl file to hosted server

I would like to be able to update an xml file located on my hosted server
from my local computer.

The server requires a user name and password to access the web site for
writing or updating files.

Could someone refer me to a doc that explains this or provide some sample
code?

Thanks,

Dennis
Nov 17 '05 #1
7 2052
Hello there.

I believe that you should use the XmlValidatingRe ader class. To use this
object, you should first load an XmlTextReader object with the appropiate
document. When an XmlValidatingRe ader object is instantiates, the
XmlTextReader object supplies the XML document. Next, you should set the
ValidationType property of the XmlValidatingRe ader object so that it will
know how to properly validate the XML doc. In your scenario, you need to
supply a user name and passwd in order to access the XML doc and maybe the
schema file? To accomplish this, you must supply credentials to the
XmlResolver property of the XmlValidatinRea der object. However, it's not
possible to retrieve credentials FROM the XmlResolver property.

How can you do this? By using the object NetworkCredenti al assigned to the
property Credentials of the XmlResolver.

Here is a code sample that you may use.

XmlTextReader myTextReader = new
XmlTextReader("//YouServer/yourXMLFile.xml ");
XmlValidatongRe ader myValidatingRea der = new
XmlValidatingRe ader(myTextRead er);
MyValidatingRea der.ValidationT ype = ValidationType. Schema;
NetworkCredenti al myCredentials = new NetworkCredenti al(strUserName,
strPasswd, strDomain);
myValidatingRea der.XmlResolver .Credentials = myCredentials;

voilá, there you should have access to the file you need.

Hope this helps

Steven Lewis

"Dennis C. Drumm" <dc******@commu nity.nospam> escribió en el mensaje
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
I would like to be able to update an xml file located on my hosted server
from my local computer.

The server requires a user name and password to access the web site for
writing or updating files.

Could someone refer me to a doc that explains this or provide some sample
code?

Thanks,

Dennis

Nov 17 '05 #2
Steven:

Isn't a reader for reading files not writing them. I want to write to an xml
file located on my hosted server (one that is not part of my office's
domain.

Thanks,

Dennis
"Steven Lewis" <am*******@hotm ail.com> wrote in message
news:eC******** *****@TK2MSFTNG P15.phx.gbl...
Hello there.

I believe that you should use the XmlValidatingRe ader class. To use this
object, you should first load an XmlTextReader object with the appropiate
document. When an XmlValidatingRe ader object is instantiates, the
XmlTextReader object supplies the XML document. Next, you should set the
ValidationType property of the XmlValidatingRe ader object so that it will
know how to properly validate the XML doc. In your scenario, you need to
supply a user name and passwd in order to access the XML doc and maybe the
schema file? To accomplish this, you must supply credentials to the
XmlResolver property of the XmlValidatinRea der object. However, it's not
possible to retrieve credentials FROM the XmlResolver property.

How can you do this? By using the object NetworkCredenti al assigned to the
property Credentials of the XmlResolver.

Here is a code sample that you may use.

XmlTextReader myTextReader = new
XmlTextReader("//YouServer/yourXMLFile.xml ");
XmlValidatongRe ader myValidatingRea der = new
XmlValidatingRe ader(myTextRead er);
MyValidatingRea der.ValidationT ype = ValidationType. Schema;
NetworkCredenti al myCredentials = new NetworkCredenti al(strUserName,
strPasswd, strDomain);
myValidatingRea der.XmlResolver .Credentials = myCredentials;

voilá, there you should have access to the file you need.

Hope this helps

Steven Lewis

"Dennis C. Drumm" <dc******@commu nity.nospam> escribió en el mensaje
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
I would like to be able to update an xml file located on my hosted server
from my local computer.

The server requires a user name and password to access the web site for
writing or updating files.

Could someone refer me to a doc that explains this or provide some sample
code?

Thanks,

Dennis


Nov 17 '05 #3
Hi Dennis,

As for create/modify file/document on webserver, we can not use the buildin
file system(system.i o) or xml (system.xml) apis in .net framework to do it.
In fact, normally, the webserver won't allow HTTP protocal based file
manipulation on server. As far as I know, the only available means
(manipulating documents on webserver through http protocal ) are using the
WEBDAV which is a publish standard that many servers (IIS, exchange ...)
has supported ).

WebDav is rely on XML, when we want to create/ update files/resources on a
certain server, we just send WebDav message to the server , the message is
xml based and can be sent through HTTP request. For detailed info on
WebDav, you can have a look at the following site:

# WebDAV Resources
http://www.webdav.org/

And currently the latest IIS server support communicattion with webdav. We
need to do some configuration on the serverside so as to enable the WebDav
and then using the proper component to send the XML based webdav requests
to server. Here are some tech articles discussing on the related info:

#Using WebDAV with IIS
http://www.wown.com/articles_tutorials/WebDAV-IIS.html

#Communicating XML Data over the Web with WebDAV
http://msdn.microsoft.com/library/en...bdav.asp?frame
=true

In addition, to make things convenience, if it's ok to provide a certain
public dyanmic webpage or webservice on the webserver(in your scenario),
I'd rather recommend that you publish such a dynamic webpage/webservice
which will do the actual file manipulation tasks on the server, then all
the client apps just need to interact with that page/service.

How do you think? If there're anything unclear, please feel free to post
here. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



Nov 17 '05 #4
Hi Dennis,

Have you got any further ideas on this question? Does the things I posted
in the previous message helped?
If there're any thing else we can help, please feel free to post here.
Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 17 '05 #5
Sorry for the delay responding, I was away from the office for a couple of
days.

Anyway, the response above does not seem appropriate, since he suggests
adding credentials for a reader not a writer. I don't see how that will help
me to update or write to an xml document on my hosted server, a server that
has a web address versus a local domain address for my office.

So, yes, I would appreciate a little more information on this subject.

thanks,

Dennis
"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:WV******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hi Dennis,

Have you got any further ideas on this question? Does the things I posted
in the previous message helped?
If there're any thing else we can help, please feel free to post here.
Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 17 '05 #6
Hi Dennis,

Of course what I meant were not what Steven Lewis has mentioned(using
XmlDocument or XmlReader/XmlWriter.... ), that's not possible for
modifying serverside document/files.

Have you viewed my last message which mentioned the WebDav and some other
approachs(which require a certain dynamic page on the server) ? Anyway,
I'll repaste my previous reply here for your reference:
=============== =======
As for create/modify file/document on webserver, we can not use the buildin
file system(system.i o) or xml (system.xml) apis in .net framework to do it.
In fact, normally, the webserver won't allow HTTP protocal based file
manipulation on server. As far as I know, the only available means
(manipulating documents on webserver through http protocal ) are using the
WEBDAV which is a publish standard that many servers (IIS, exchange ...)
has supported ).

WebDav is rely on XML, when we want to create/ update files/resources on a
certain server, we just send WebDav message to the server , the message is
xml based and can be sent through HTTP request. For detailed info on
WebDav, you can have a look at the following site:

# WebDAV Resources
http://www.webdav.org/

And currently the latest IIS server support communicattion with webdav. We
need to do some configuration on the serverside so as to enable the WebDav
and then using the proper component to send the XML based webdav requests
to server. Here are some tech articles discussing on the related info:

#Using WebDAV with IIS
http://www.wown.com/articles_tutorials/WebDAV-IIS.html

#Communicating XML Data over the Web with WebDAV
http://msdn.microsoft.com/library/en...bdav.asp?frame
=true

In addition, to make things convenience, if it's ok to provide a certain
public dyanmic webpage or webservice on the webserver(in your scenario),
I'd rather recommend that you publish such a dynamic webpage/webservice
which will do the actual file manipulation tasks on the server, then all
the client apps just need to interact with that page/service.

How do you think? If there're anything unclear, please feel free to post
here. Thanks,

=============== =======

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 17 '05 #7
Hi Dennis,

Of course what I meant were not what Steven Lewis has mentioned(using
XmlDocument or XmlReader/XmlWriter.... ), that's not possible for
modifying serverside document/files.

Have you viewed my last message which mentioned the WebDav and some other
approachs(which require a certain dynamic page on the server) ? Anyway,
I'll repaste my previous reply here for your reference:
=============== =======
As for create/modify file/document on webserver, we can not use the buildin
file system(system.i o) or xml (system.xml) apis in .net framework to do it.
In fact, normally, the webserver won't allow HTTP protocal based file
manipulation on server. As far as I know, the only available means
(manipulating documents on webserver through http protocal ) are using the
WEBDAV which is a publish standard that many servers (IIS, exchange ...)
has supported ).

WebDav is rely on XML, when we want to create/ update files/resources on a
certain server, we just send WebDav message to the server , the message is
xml based and can be sent through HTTP request. For detailed info on
WebDav, you can have a look at the following site:

# WebDAV Resources
http://www.webdav.org/

And currently the latest IIS server support communicattion with webdav. We
need to do some configuration on the serverside so as to enable the WebDav
and then using the proper component to send the XML based webdav requests
to server. Here are some tech articles discussing on the related info:

#Using WebDAV with IIS
http://www.wown.com/articles_tutorials/WebDAV-IIS.html

#Communicating XML Data over the Web with WebDAV
http://msdn.microsoft.com/library/en...bdav.asp?frame
=true

In addition, to make things convenience, if it's ok to provide a certain
public dyanmic webpage or webservice on the webserver(in your scenario),
I'd rather recommend that you publish such a dynamic webpage/webservice
which will do the actual file manipulation tasks on the server, then all
the client apps just need to interact with that page/service.

How do you think? If there're anything unclear, please feel free to post
here. Thanks,

=============== =======

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 17 '05 #8

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

Similar topics

2
7522
by: Angelo Vargheese | last post by:
Hi, I am trying to retrieve XML created by ASP pages on different servers and display them on a single ASP.Net page. I was planning to use the XMLDocument and XMLResolver objects like below: xmlResolver.Credentials = CredentialCache.DefaultCredentials xmlDoc = New XmlDocument xmlDoc.XmlResolver = xmlResolver
4
2204
by: Grind Boy | last post by:
Hi, I'm writing this off the top of my head as I don't have the exact information to hand. We are attempting to set up a secure internet site using ASP.NET on IIS5. We are having some authentication problems early on in the project. The plan is to have 1 ASP.NET (IIS) forms application serving user requests and another ASP.NET (IIS) webservice interfacing to the database.
19
2546
by: Siobhan | last post by:
Hi What is the recommended way to store a user's database credentials across the pages of a web application so that each time the database is accessed the system doesn't have to ask them for their username and password again We have previously stored these in a session variable (encrypted) and retrieved from their - but are worried about the impact on performance if the number of users increases. Had thought about cookies but worried...
2
4182
by: cindy.fisher | last post by:
I am using DownloadFile() on a C# web app to download a file to a client. When I set the WebClient credentials to the DefaultCredentials, I get a 401 Unauthorized exception. WebClient myWC = new WebClient(); myWC.Credentials = CredentialCache.DefaultCredentials; myWC.DownloadFile(myRemoteUri, myFile); However, when I set the credentials using a username and password it works.
3
2622
by: Jay-nospam | last post by:
Hi there, I am having trouble getting an ASP.NET web application to connect to another computer and passing the proper credentials and I hope someone can help me. I have a stand-alone Windows 2003 Server, ServerA, running as a Web Server that uses ASP.NET. The default.aspx file tries to access a file in a share on another computer, ServerB. ServerA and ServerB are on the same domain and are both running Windows 2003 Server.
0
1670
by: rohitscripts | last post by:
I'm uploading an image from my aspx page to a folder(not in database) in ftp server using the following code:: System.IO.FileStream newFile = new System.IO.FileStream(Server.MapPath(sSavePath + sFilename),System.IO.FileMode.Create,FileAccess.ReadWrite, FileShare.ReadWrite); newFile.Write(myData, 0, myData.Length); I'm using a fileupload control to select an image. now, when i'm running this page from my...
2
8561
by: IronMike | last post by:
I'm writing a program that needs to write files to a network share. My problem is that the program users are working on PCs that are not connected to our domain and the program needs to save files to a network share on the domain. It's not feasible to change all of the user accounts on the PCs to match the user's domain credentials so I want to prompt the user for credentials (they all have domain accounts to access Citrix) and then use those...
5
4135
by: =?Utf-8?B?SmltbWVy?= | last post by:
Hello, I've been trying to create a WCF SOAP Router Service that can forward not just the message body but also any security headers set by the originator of the message. The destination service I'm routing messages to uses WSHttpBinding, SSL with UserName/Password client credentials. Using guidance from the Technology samples I can create a router that forwards messages without security credentils but not with them. Can anybody point me...
0
1746
by: =?Utf-8?B?UG1hX1NoYW5l?= | last post by:
I have created a self hosted service using WCFa and I want to provide my own wsdl from a local file rather than the generated wsdl - how can I do this? I actually need to produce a web service which is compatible with existing clients build for a asmx service as explained here: http://msdn.microsoft.com/en-us/library/aa738697.aspx. This article assumes you are going to host in IIS however. I managed to get a working stand alone server...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9906
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7456
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2850
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.