473,406 Members | 2,619 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,406 software developers and data experts.

WebService returns HTTP/1.1 401 Unauthorized

Hi all.

I am trying to get data from a 3rd party webservice. It seems the
webservice is running on an iis server. Fiddler shows me:

"Server: Microsoft-IIS/6.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET"

Fiddler shows furthermore:

"Access is denied.

Description: An error occurred while accessing the resources required
to serve this request. This may have been caused by an incorrect user
name and/or password.

Error message 401.1: Logon credentials were not recognized. Make sure
you are providing the correct user name and password. Otherwise,
contact the Web server's administrator for help."

If i paste the webservice url into my browser there is a prompting
dialog for username and password. With my login data everything works
fine and i can see the wsdl.

Now, here my code how i try to access the webservice:

myCredentials = new
System.ServiceModel.Description.ClientCredentials( );
myCredentials.UserName.UserName = "myUser";
myCredentials.UserName.Password = "myPass";

WSClient myWSClient = new WSClient();
myWSClient.ClientCredentials.UserName.UserName =
myCredentials.UserName.UserName;
myWSClient.ClientCredentials.UserName.Password =
myCredentials.UserName.Password;

WSDataResponse myWSDataResponse = new WSDataResponse();
myWSDataResponse.CultureCode = "de-DE";

WSDataRequest myWSDataRequest = new WSDataRequest();
myWSDataRequest.CultureCode = "de-DE";

myWSDataResponse = myWSClient.GetWSData(myWSDataRequest);
WSDataDictionary[] myWSDataDictionary =
myWSDataResponse.WSDataDictionary;

It is the first time i work with WebServices. I dont know if you need
more informationen. Can somebody help me to find a solution for this?

Greetz
Sebastian
Jun 27 '08 #1
9 5209

"Sebastian K." <gi*****@web.dewrote in message
news:r6********************************@4ax.com...
Hi all.

I am trying to get data from a 3rd party webservice. It seems the
webservice is running on an iis server. Fiddler shows me:
You contact the 3rd party vendor and you talk to them about your issues.
It's their Web server and Web service.

Jun 27 '08 #2
Yes, thats right... But at first i wanted to check if i have done some
mistakes. Any other suggestions?

Greetz
Sebastian
>
"Sebastian K." <gi*****@web.dewrote in message
news:r6********************************@4ax.com.. .
>Hi all.

I am trying to get data from a 3rd party webservice. It seems the
webservice is running on an iis server. Fiddler shows me:

You contact the 3rd party vendor and you talk to them about your issues.
It's their Web server and Web service.
Jun 27 '08 #3

"Sebastian K." <gi*****@web.dewrote in message
news:8p********************************@4ax.com...
Yes, thats right... But at first i wanted to check if i have done some
mistakes. Any other suggestions?
Go to the horse's mouth, ask the 3rd party vendor for support and let them
tell you what is wrong with your code. There is nothing wrong in doing that,
and most likely it's going to solve your problem quickly.

Jun 27 '08 #4
>Go to the horse's mouth, ask the 3rd party vendor for support and let them
>tell you what is wrong with your code. There is nothing wrong in doing that,
and most likely it's going to solve your problem quickly.
Hey, i already know your opinion, thank you... But maybe the
webservice provider cant help me, and then?!?... You dont have to
answer if you wont help.

Is there maybe someone who could help?

Greetz
Sebastian
Jun 27 '08 #5
Sebastian K. wrote:
>
Hey, i already know your opinion, thank you... But maybe the
webservice provider cant help me, and then?!?... You dont have to
answer if you wont help.
I can't help, I'm afraid, because I have a very similar issue.

The difficulty arises where (as in my case and possibly in yours) you
are trying to connect to a 3rd party Web service that is not written
using the .NET Framework and/or the Visual Studio WSE plugin.

It is worth talking to them, though. In my case I'm in almost constant
touch, but there's not much they can do because they don't know anything
about .NET.

You might be able to help me, though. How did you get Fiddler to return
anything useful to you? I get some stuff back, but nothing that looks
like the message on the line, or any kind of XML.

Could it be because I have to make an HTTPS connection? Does Fiddler
not work so well in those circumstances?

Cheers

Peter
Jun 27 '08 #6
>You might be able to help me, though. How did you get Fiddler to return
>anything useful to you? I get some stuff back, but nothing that looks
like the message on the line, or any kind of XML.

Could it be because I have to make an HTTPS connection? Does Fiddler
not work so well in those circumstances?
Hi Peter.

Fiddler should capture HTTPS Traffic too, there is an extra option
under Rules to hide these traffic. But i havent tested it yet with
https connections (maybe there is a faq on the fiddler homepage).

During the test with my Client Application fiddler was started and
captured all traffic. Then i have clicked on the specific web session
(left panel) and on the right panel you should click on Sessions
Inspector (Tabs: Headers and TextView)

Hope i could help so far.

Greetz
Sebastian
Jun 27 '08 #7

"Sebastian K." <gi*****@web.dewrote in message
news:pv********************************@4ax.com...
Go to the horse's mouth, ask the 3rd party vendor for support and let
them
tell you what is wrong with your code. There is nothing wrong in doing
that,
and most likely it's going to solve your problem quickly.

Hey, i already know your opinion, thank you... But maybe the
webservice provider cant help me, and then?!?... You dont have to
answer if you wont help.

Is there maybe someone who could help?
If the Web Service provider can't help with the authentication problem, then
no one is going to help you. And you have serious problems.

You can lead a horse to water, but you can't make the horse drink. It's the
3rd party vendor's Web server and its Web service. I bet they don't have any
problems in making contact.

For all you know, maybe the Web Service needs SOAP Authentication. It's
seems that you might be sending a plain text User-ID and PSW that anyone can
spoof on the wire. Most Web service providers use SOAP Authentication to
encrypt the User-ID and PSW. Maybe, that's your problem if you have never
talked to the 3rd party vendor on how to make contact.

With my first WEB service contact using a 3rd party vendor, you had better
bet that
I got on the phone with the provider that gave me all I needed to make
contact, and what I needed to do in code to make the contact when I
couldn't.

I got on the phone with a developer.
Jun 27 '08 #8

"Sebastian K." <gi*****@web.dewrote in message
news:pv********************************@4ax.com...
Go to the horse's mouth, ask the 3rd party vendor for support and let
them
tell you what is wrong with your code. There is nothing wrong in doing
that,
and most likely it's going to solve your problem quickly.

Hey, i already know your opinion, thank you... But maybe the
webservice provider cant help me, and then?!?... You dont have to
answer if you wont help.

Is there maybe someone who could help?
If the Web Service provider can't help with the authentication problem, then
no one is going to help you. And you have serious problems. You are shooting
blanks here, if you think someone here is actually going to solve the
problem for you.

You can lead a horse to water, but you can't make the horse drink. It's the
3rd party vendor's Web Server and its Web service. I bet they don't have any
problems in making contact.

For all you know, maybe the Web Service needs SOAP Authentication. With my
first WEB service contact using a 3rd party vendor, you had better bet that
I got on the phone with the provider that gave me all I needed to make
contact and what I needed to do in code to make the contact when I couldn't.
I got on the phone with a developer.

You don't actually think someone here that knows nothing about the 3rd party
vendor is going to give you a solution?
Jun 27 '08 #9
Sebastian K. wrote:
Hi Peter.

Fiddler should capture HTTPS Traffic too, there is an extra option
under Rules to hide these traffic. But i havent tested it yet with
https connections (maybe there is a faq on the fiddler homepage).

During the test with my Client Application fiddler was started and
captured all traffic. Then i have clicked on the specific web session
(left panel) and on the right panel you should click on Sessions
Inspector (Tabs: Headers and TextView)

Hope i could help so far.

Greetz
Sebastian
Thanks Sebastian,

Yeah. I've done all that.

What I really need to get is the XML output that is being sent, so that
I can check that it's correct. But it doesn't look as though I can do
that. FWIW, in the Text View, I get:

This is a HTTPS CONNECT Tunnel. Secure traffic flows through this
connection.

Secure Protocol: Tls
Cipher: Rc4 128bits
Hash Algorithm: Md5 128bits
Key Exchange: RsaSign 1024bits

== Client Certificate ==========
None.

== Server Certificate ==========
[Subject]
CN=secure.heservices.slc.co.uk, OU=ICT, O=Student Loans Company Ltd,
L=Glasgow, S=Lanarkshire, C=GB

[Issuer]
OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign,
OU=VeriSign International Server CA - Class 3, OU="VeriSign, Inc.",
O=VeriSign Trust Network

[Serial Number]
2CDBCC4713E7909EA0BBEE7B8FB44C2F

[Not Before]
04/06/2008 01:00:00

[Not After]
06/06/2010 00:59:59

[Thumbprint]
C9B6874E5863777DFE0874683351B305AA827329

That doesn't mean a lot to me, and isn't what I need. I really need to
see that message that is going up the wire.

Oh well!
Peter
Jun 27 '08 #10

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

Similar topics

0
by: ALI-R | last post by:
Hi All, I have a webservice on a win 2003 server and I'm trying to call it from another win2003 server which is hosting my sharepoint portal server. I am trying to call that webservice from a...
1
by: aaa | last post by:
What is the most efficient way to do a check to see if a webservice exists before attempting to execute. I was thinking of just creating an HTTP object then initiating a request to see if i get a...
5
by: mtv | last post by:
Hi all, I have the following code: ================================ Webservice side: public class MyWS: WebService { private myLib.DataObject curDataObject;
7
by: Nalaka | last post by:
Hi, I created a sinple web service that returns a dataSet. Then I created a client program that uses this web service (that returns the Dataset). My question is, how did the client figure...
0
by: Oleg Korda | last post by:
Greetings, How do I call WebService secured with LiveId authentication? I try to execute the following c# code: SharepointWS.Lists ListsService = new SharepointWS.Lists();...
0
by: jocbor | last post by:
Hi! We are calling a webservice in a third party application for integration purposes. The scenario is that messages arrive on msmq. We have a windows service (using a domain account)...
2
by: =?Utf-8?B?TGFycnlLdXBlcm1hbg==?= | last post by:
Our WebDev team seems to have found a problem that exposes a bug in .NET 2.0. This problem can be shown when trying to access a WebService using SSL and through a proxy server after using the...
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...
7
by: Amirallia | last post by:
Hi, I consume my webservice with the IE browser and all is ok when I call it with one browser. But when I call it a the same time with two browsers, the IE page tells me that the apllication...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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.