Hello all
I've a problem, I need to develop a component to connect a web
service for
sending SMS. The web service it's not implemented in .NET.I need to use basic
authentication (at least that is what I've been told). The most strange thing
is that when I add the web reference in Visual Studio .NET I'm not asked for
authentication. Apart from this, it's the web service who tells me I'm not
authenticated
instead of the server.
I've monitored the HTTP packets, sent and received, of a correct execution.
The
only significant difference is that the header of the first HTTP packet is
the following line:
"Authorization: Basic cGlhj2dsOmcfswnNzcGgg7e="
When it's me who runs the service I can't get that line to be sent.
On the other hand, I've created a test web service in other machine using
..NET
and using basic authentication. When developing a client, at the point that
the web reference
is added, i'm requested to type a user and passwd. When running the client,
I monitor the net and
that line ("...Authorization....") is present.
does anyone know why this line would not be included in the HTTP header when
using an apache server??
Thanks a lot. 4 1954
> "Authorization: Basic cGlhj2dsOmcfswnNzcGgg7e="
You have to add the header yourself:
YourWebRequest.Headers.Add("Authorization", "Basic "
+ "cGlhj2dsOmcfswnNzcGgg7e=";
Greetings,
Wessel
very thanks.
that works with a web request, but would you know how to do this with a web
service client on visual studio .net. It doesn't have that method
(Header.Add) in my web service consumer class.
"Wessel Troost" wrote: "Authorization: Basic cGlhj2dsOmcfswnNzcGgg7e=" You have to add the header yourself:
YourWebRequest.Headers.Add("Authorization", "Basic " + "cGlhj2dsOmcfswnNzcGgg7e=";
Greetings, Wessel
As I said, the service class doesn't have the GetWebRequest method, but the
SoapHttpClientProtocol class from which it inherits has this method as
protected. I'll try to make it public on my service class.
I'll keep you informed, ;)
"Jose" wrote: very thanks.
that works with a web request, but would you know how to do this with a web service client on visual studio .net. It doesn't have that method (Header.Add) in my web service consumer class.
"Wessel Troost" wrote:
"Authorization: Basic cGlhj2dsOmcfswnNzcGgg7e=" You have to add the header yourself:
YourWebRequest.Headers.Add("Authorization", "Basic " + "cGlhj2dsOmcfswnNzcGgg7e=";
Greetings, Wessel
Hi all again,
I've found the solution for my problem. I've overrided the GetWebRequest
method as follow:
protected override System.Net.WebRequest GetWebRequest(System.Uri uri) {
System.Net.WebRequest req = base.GetWebRequest(uri);
req.Headers.Add("Authorization", "Basic cGdSY2asOmFhdfanNGxwaWd9");
return req;
}
Thanks all again
"Jose" wrote: Hello all
I've a problem, I need to develop a component to connect a web service for sending SMS. The web service it's not implemented in .NET.I need to use basic authentication (at least that is what I've been told). The most strange thing is that when I add the web reference in Visual Studio .NET I'm not asked for authentication. Apart from this, it's the web service who tells me I'm not authenticated instead of the server. I've monitored the HTTP packets, sent and received, of a correct execution. The only significant difference is that the header of the first HTTP packet is the following line: "Authorization: Basic cGlhj2dsOmcfswnNzcGgg7e="
When it's me who runs the service I can't get that line to be sent.
On the other hand, I've created a test web service in other machine using .NET and using basic authentication. When developing a client, at the point that the web reference is added, i'm requested to type a user and passwd. When running the client, I monitor the net and that line ("...Authorization....") is present.
does anyone know why this line would not be included in the HTTP header when using an apache server?? Thanks a lot. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Sparky |
last post by:
Hi,
I am trying to use a typed dataset with a web service and am having problems
with type casting errors.
I have a typed dataset which is in both my web service and my consuming
application....
|
by: leslie_tighe |
last post by:
Hello,
I have webservice created with Axis 1.2.1 and that I am trying to
consuming in .NET (VB) using the Microsoft provided tools. While I am
able to consume methods on the service that return...
|
by: Alexiel |
last post by:
Hi, i have a problem, I have a Java Client and i call my webservice on
..NET.
This run perfectly just except when i send parameters don't work fine.
I send my code :
This is my java...
|
by: cjharrelson |
last post by:
I am trying to consume a .NET web service using UsernameToken plain
text password authentication.
Here is my .wsdd configuration file:
<!-- Using the WSDoAllSender security handler in request...
|
by: Philip Reimer |
last post by:
Hello.
We have here a Java web service that has been created using Apache Axis
1.4, using the document/literal wrapped style, and returns complex types
in its methods.
When consuming the web...
|
by: Jeremy Chapman |
last post by:
I've writtin a very simple web service in axis which returns an array of
classes.
I consume it in a .net app. When receiving the response, my .net app
generates an error "Cannot assign object...
|
by: Thomas Mueller |
last post by:
Hi,
I'm currently working on C# code consuming a PHP-webservice
(soapserver-class of PHP5). A PHP test-client worked fine and achieved
the requested data from the service's server.
Using the...
|
by: sethupnr |
last post by:
when i'm using a simple JSP-mysql code it shows some HTTP status 500 error.But simple JSP program without databse is running , Please help how to solve this problem. I'm new to JSP.
my...
|
by: menmaatre |
last post by:
Hi all,
I have a very odd problem:
- System A: Win 2k3 with IIS 6 exposing a little WSDL Webservice
- System B: Win 2k3 with MSSQL Server 2k5
- System C: RedHat Enterprise Server running...
|
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,...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
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...
|
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...
|
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: 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,...
|
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,...
|
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...
| |