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

.NET based SOAP proxy and HTTP Basic Authentication


Hi,

I've created a small forms based application in c# to test a vendor's
product and the web service interface that it exposes. We have deployed two
instances of the vendor product one which has an unprotected (no
authentication) interface and one that is protected using HTTP basic
authentication.

I can invoke methods on the unprotected instance and everything's fine. When
I attempt to invoke methods on the protected instance the request sent in
response to the challenge from the server is truncated and has no message
body.

Ethereal trace below:

POST /ProvisionInterface HTTP/1.1
VsDebuggerCausalityData: <data snipped>
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client
Protocol 1.1.4322.2032)
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://www.blug.com/wsdlUserExists"
Content-Length: 387
Expect: 100-continue
Connection: Keep-Alive
Host: 1.2.3.4:50000

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<UserExists xmlns="http://www.blug.com/wsdl">
<PublicID>
<id>te***@bt.co.uk</id>
<type>1</type>
</PublicID>
</UserExists>
</soap:Body>
</soap:Envelope>

HTTP/1.1 401 UNAUTHORIZED
WWW-Authenticate: Basic realm="ProvisionInterface"
cache-control: no-cache
content-length: 25
content-type: text/html
date: Thu, 22 Jun 2006 12:35:34 GMT
last-modified: Thu, 22 Jun 2006 12:35:34 GMT

POST /ProvisionInterface HTTP/1.1
VsDebuggerCausalityData: <data snipped>
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client
Protocol 1.1.4322.2032)
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://www.blug.com/wsdlUserExists"
Authorization: Basic UFdTSToxMjM0
Content-Length: 387
Expect: 100-continue
Host: 1.2.3.4:50000

<*** message body missing/truncated ***>

The only means I know of influencing the authentication phase is by
attaching a NetworkCredential object to the SOAP proxy and the authentication
process is transparent to the application as far as I'm aware.

Has anyone else experienced this problem ?

Thanks,

Tony
Jun 23 '06 #1
1 9440
I've figured out what the problem was (for anyone else who's interested).

It appears that the vendor product is not responding to the
Expect:100-Continue header correctly (i.e. returning 417 Expectation Failed
to indicate it's not a supported feature) and so the SOAP proxy is waiting
for a 100 Continue provisional response prior to sending the message body.

The following line of code stops the SOAP proxy from adding this header to
the SOAP request:

System.Net.ServicePointManager.Expect100Continue = false;
Regards,

Tony

"Tony Stephens" wrote:

Hi,

I've created a small forms based application in c# to test a vendor's
product and the web service interface that it exposes. We have deployed two
instances of the vendor product one which has an unprotected (no
authentication) interface and one that is protected using HTTP basic
authentication.

I can invoke methods on the unprotected instance and everything's fine. When
I attempt to invoke methods on the protected instance the request sent in
response to the challenge from the server is truncated and has no message
body.

Ethereal trace below:

POST /ProvisionInterface HTTP/1.1
VsDebuggerCausalityData: <data snipped>
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client
Protocol 1.1.4322.2032)
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://www.blug.com/wsdlUserExists"
Content-Length: 387
Expect: 100-continue
Connection: Keep-Alive
Host: 1.2.3.4:50000

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<UserExists xmlns="http://www.blug.com/wsdl">
<PublicID>
<id>te***@bt.co.uk</id>
<type>1</type>
</PublicID>
</UserExists>
</soap:Body>
</soap:Envelope>

HTTP/1.1 401 UNAUTHORIZED
WWW-Authenticate: Basic realm="ProvisionInterface"
cache-control: no-cache
content-length: 25
content-type: text/html
date: Thu, 22 Jun 2006 12:35:34 GMT
last-modified: Thu, 22 Jun 2006 12:35:34 GMT

POST /ProvisionInterface HTTP/1.1
VsDebuggerCausalityData: <data snipped>
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client
Protocol 1.1.4322.2032)
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://www.blug.com/wsdlUserExists"
Authorization: Basic UFdTSToxMjM0
Content-Length: 387
Expect: 100-continue
Host: 1.2.3.4:50000

<*** message body missing/truncated ***>

The only means I know of influencing the authentication phase is by
attaching a NetworkCredential object to the SOAP proxy and the authentication
process is transparent to the application as far as I'm aware.

Has anyone else experienced this problem ?

Thanks,

Tony

Jun 23 '06 #2

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

Similar topics

0
by: conradwt | last post by:
Hi, I'm configuring a PHP script to use HTTP Basic Authentication. Thus, is it possible to test basic authentication using 'localhost'? If so, could someone send me a working .htaccess file because...
4
by: jeff | last post by:
does anyone can help me with following situation. I use win32com.client to dispatch IE for a URL browing. However, the URL I am going require a HTTP basic authentication login. When IE starts to...
0
by: Vivek | last post by:
Hi, Can anyone provide me with sample code that will allow me to use SOAPpy with a WSDL file using HTTP basic authentication? The only thing I've been able to find on the net is...
7
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. #...
3
by: Yodai | last post by:
Hi all... I have this project on an embbeded system where I've programmed a very simple dynamic web-server on C, which serves 1 connection at a time. I need to implement a basic authentication...
13
by: Pete | last post by:
I'm cross posting from mscom.webservices.general as I have received no answer there: There has been a number of recent posts requesting how to satisfactorily enable BASIC authorization at the...
3
by: Gilles Ganault | last post by:
Hello I have a PHP script rss.php that serves RSS to clients. It work fine, but I'd like to server customized contents, and for this, I need to know who the user is. Unless there's a better...
3
by: Max | last post by:
Following the tutorial at http://personalpages.tds.net/~kent37/kk/00010.html, I understand how to access HTTP basic authenticated pages or form- based authenticated pages. How would I access a page...
0
by: Tom | last post by:
Hi, I need to connect to a SOAP web service (Java server) that requires basic HTTP authentication over HTTP (not HTTPS). I've tried the following setup: <security...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
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
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.