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

HTTP status 403: Forbidden

I created a desktop application (vb.net) which access my webservice. I have a
client which is behind a firewall and can not log on to the webservice. They
have been getting the error: System.Net.WebException: The request failed with
HTTP status 403: Forbidden.

Any ideas on what I can do. Here is my code.

Dim myService As New AIMWS.DataServ1Wse
Dim proxyObject As New System.Net.WebProxy(m_strURLLocation, True)
myService.Proxy = proxyObject
myService.Ping()

<System.Web.Services.Protocols.SoapDocumentMethodA ttribute(WebServiceAddress
& "/Ping", RequestNamespace:=WebServiceAddress,
ResponseNamespace:=WebServiceAddress,
Use:=System.Web.Services.Description.SoapBindingUs e.Literal,
ParameterStyle:=System.Web.Services.Protocols.Soap ParameterStyle.Wrapped)> _
Public Function Ping() As Integer
Dim results() As Object = Me.Invoke("Ping", New Object(-1) {})
Return CType(results(0),Integer)
End Function

<WebMethod()> Public Function Ping() As Integer
If Authenticater() Then
' Just make sure that Ping works, to see if the web service is
valid
End If
End Function

Private Function Authenticater() As Boolean
Dim requestContext As SoapContext = HttpSoapContext.RequestContext
Dim userToken As UsernameToken
Dim returnValue As String

If requestContext Is Nothing Then
Throw New SoapException("Non-SOAP Message - Are you a hacker?",
SoapException.ClientFaultCode)
End If

For Each userToken In requestContext.Security.Tokens
If TypeOf userToken Is UsernameToken Then
If userToken.PasswordOption = PasswordOption.SendHashed Then
Return True
Exit For
Else
Throw New SoapException("Password must be hashed",
SoapException.ClientFaultCode)
End If
End If
Next
End Function

--
Thanks,
JeffS
Nov 23 '05 #1
0 4372

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

Similar topics

6
by: R. Rajesh Jeba Anbiah | last post by:
Is it necessary or is there any standard to send HTTP header status for form inputs ? Say, the user is entering invalid password in login form and now all the applications I have seen are just...
2
by: edsuslen | last post by:
I am migrating working code (HTTPRequest with Authentication) from vb to vb.net vb: Set objXMLHTTPServer = New MSXML2.XMLHTTP30 objXMLHTTPServer.Open strMethod, strGetRequest, False, "UserId",...
2
by: Edward Low | last post by:
Hi all, When creating a virtual directory in IIS 5.0 win xp Pro with the name like "abc.com", an error HTTP 403.1 Forbidden: Execute Access Forbidden will return when accessing the web page. But,...
0
by: 220rounder | last post by:
Hi..Created a simple web service in MS Visual Studio 2005 on my dev laptop. I can access it fine on the laptop. I then created a web setup project and deployed it to an app server. I now get an...
1
by: PK9 | last post by:
I am receiving the following error in Visual Studio 2003: "the web server reported the following error when attempting to create or open the web project HTTP/1.1 403 Access Forbidden" I am...
0
by: karlag92 | last post by:
Using C# .Net V 1.1.4322, I am attempting to call some web services that will ONLY be consumed by our Winforms client application. I have my web service security working from the browser by...
6
by: alho | last post by:
The web service is called by a program running on pocket pc. When to call the web service, the first call is still ok, but for the second or later calls, it will throw "403 Forbidden" WebException....
16
by: Harry Simpson | last post by:
I've been away from ASPNET - I open up a new Web app in VS2008 and go into properties and select to use IIS instead of the personal web server. Then I run in debug mode and it says I have to set...
8
by: amitverma60 | last post by:
Hi Guys I am getting an error in php. 403 forbidden error when i try to view my picture kept in a folder e.g www.neuronsoftsols.com/upload/75/johal1.bmp comes an error 403 forbidden? I cant...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.