473,378 Members | 1,330 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Accessing a web service in a password protected directory

Hi,

I have developed a web service in PHP using NuSOAP. I want some form of
security for this WS, so I've put it in a directory which is password
protected, using an htaccess file. The authentication type is Basic.

Now I'm developing a client app, written in C#, to consume this web service,
but I'm having a bit of trouble to access it. I've done something similar to
the example I found at MSDN
(http://msdn.microsoft.com/library/de...-us/cpguide/ht
ml/cpconsecuringaspnetwebservices.asp) to send the necessary credentials to
the webserver. Here's my code to send the username and password, the
VrlAdministration class was generated by the wsdl tool:
VrlAdministration vrladmin = new VrlAdministration;
CredentialCache credentialCache = new CredentialCache();
NetworkCredential credentials = new NetworkCredential(txtUsername.Text,
txtPasword.Text);
credentialCache.Add(new Uri(vrladmin.Url), "Basic", credentials);
vrladmin.Credentials = credentialCache;
I keep getting an "HTTP 400: Bad Request" response from the web server. I
know that there must be something going wrong while sending the credentials,
because when I call the web service when the password protection is off, I
do get the desired result.

What can I do to solve this? And is it even possible to access a directory
which is protected by an htaccess file? Or can I only use this method when
the webserver is running IIS (which is not an option, our webhosting is on a
Linux platform with the usual Apache-PHP-MySQL configuration. It's been
payed for, and I don't want the hassle of cancelling our account,
transferring the domainname,...)?


Nov 16 '05 #1
0 1992

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

Similar topics

3
by: Wm | last post by:
Something just occurred to me... <yeah, I know, it scared me too> I just password-protected a website by including a password authentication script in each page of a private section. The script...
3
by: Chris | last post by:
Hello all, Here is my problem. I have a windows service (C#) that is supposed to move files from/to the local drive to/from a UNC share (\\domainserver\share). The service is running on a Win3k...
0
by: FleaBite | last post by:
Hi, I have developed a web service in PHP using NuSOAP. I want some form of security for this WS, so I've put it in a directory which is password protected, using an htaccess file. The...
6
by: IntraRELY | last post by:
I have an WinForm (VB.NET) that is launched from an ASP.NET page that uses Form Authentication. After the WinForm is lauched it calls a web service. I want to use the credentials stored in the...
4
by: Khalique | last post by:
I have built a web service whose purpose is to copy files from a secure place to client machine and vice versa. The problem I am having is perhaps related to permissions and access rights. For...
5
by: samadams_2006 | last post by:
I'm having a problem in accessing a Microsoft Access Database in a VB.NET Web Application. It's so straight forward, I thought I'd walk you through all the details here: 1) I have a .NET Web...
3
by: samadams_2006 | last post by:
I have a Web Site that I'm interested in selling eBooks from. I'm having a problem setting it up as I would like, and hope that someone can help me out. Inside my domain I have a folder called...
0
by: rsine | last post by:
I have created my first windows service and have found that it fails when I initially start it but when I immediately try to restart the service it starts. What could be causing this behavior? I...
10
by: Anton | last post by:
Hi, when accessing a secured 3rd party webservice i'm getting a 401 HTTP Statuscode (unauthorized). When entering the url in a browser and entering the username and password manually, the wsdl is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.