473,416 Members | 1,660 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,416 software developers and data experts.

how to add "Authorization: Basic" for a web service call

Hello,
I'm having some problems with the authentication during a web service
call
I know I have to add the "Authorization: Basic xxxxxxxx" in the http
header (not soap header) but I can't find a way to add it.
I've tryed to use ethereal to watch what I'm sending and I can see all
the header
(Accept-Language,Accept-Encoding,User-Agent,Host,Connection,..) and the

SOAP xml message but there is no "Authorization: Basic ......" at all.
Could someone help me?
This is the [partial] code I'm using:

namespace WCM
{
public partial class Form1 : Form
{
public Form1(){InitializeComponent();}
private void button1_Click(object sender, EventArgs e)
{
//WSDL web reference: WebRef
//WebService: Service
WebRef.ServiceTTService = new WCM.WebRef.Service();
NetworkCredential remoteCredentials = new NetworkCredential("a",
"b");
TTService.Credentials = remoteCredentials;
WebRef.TTRequestType TTRequest = new WCM.WebRef.TTRequestType();
TTRequest.param="param";
WebRef.TTRespType TTResponse = new WCM.WebRef.TTRespType();
TTResponse = TTService.TTRequestMethod(TTRequest);
//ERROR ON THE PREVIOUS LINE:
//"The request failed with HTTP status 403: Service Error."
MessageBox.Show("DONE!");
}
}
}
Thank you in advance!
Ottavio

Nov 10 '06 #1
1 7707
Ottavio wrote:
I'm having some problems with the authentication during a web service
call
I know I have to add the "Authorization: Basic xxxxxxxx" in the http
header (not soap header) but I can't find a way to add it.
I've tryed to use ethereal to watch what I'm sending and I can see all
the header
(Accept-Language,Accept-Encoding,User-Agent,Host,Connection,..) and the

SOAP xml message but there is no "Authorization: Basic ......" at all.
Could someone help me?
Something like:

CredentialCache auth = new CredentialCache();
NetworkCredential basic = new NetworkCredential("yourusername",
"yourpassword");
auth.Add(new Uri(yourwebservice.Url), "Basic", basic);
yourwebservice.Credentials = auth;

Arne
Nov 14 '06 #2

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

Similar topics

1
by: bidalah | last post by:
Hello, I am looking for basic info on installing and using MSDE. I am trying to install and play with MSDE on my PC (Win2000). I finally managed to work my way through installation, and named...
1
by: deko | last post by:
This sub pulls Outlook Appointments into a table. The problem is I want to limit the import to Location = Boston I'm not sure how to code that into the For... To loop - As it is now, I get the...
18
by: steve | last post by:
I'm trying to create a structure of three pointers to doubles. For which I have: typedef struct { double *lst_t, *lst_vc, *lst_ic; } last_values; I then need to allocate space for...
3
by: Keith Rebello | last post by:
I have an object called ColumnSection which represents a reinforced concrete column. This object contains an arraylist called Diagrams which contains Graph2D objects which are essentially X-Y...
2
by: Ottavio | last post by:
Hello, I'm having some problems with the authentication during a web service call I know I have to add the "Authorization: Basic xxxxxxxx" in the http header (not soap header) but I can't find a...
43
by: Bill H | last post by:
25 years ago every computer came with some form of Basic interpreter so you could use yoru computer without having to buy more software. Is Javascript (teamed with HTML) set to become the new...
5
by: dabei | last post by:
Hi, I am trying to use AS3 to make a URL request with authorization header. Using the code below: var request:URLRequest = new URLRequest ( 'http://myserviceURL' ); var...
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
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...
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.