dotnet web services:
Hi all,
I'm currently trying to build a component I can use in traditional ASP
that utilizes the .NET webservice. I'm using VB.NET to create my class,
and I am registering the class for COM Interop when I compile. I'm
encountering some problems with testing using the class in a VB.NET
console application. I keep getting a http 405 error (I've never seen
this kind of error before).
In Visual Studio, I get this error:
An unhandled exception of type 'System.Net.WebException' occurred in
system.web.services.dll
Additional information: The request failed with HTTP status 405: Method
Not Allowed.
Here is the source code for the class I'm using:
Public Class Proximity
Private _strPublicStagingURL As String
Private _strPublicProductionURL As String
Private _strSecureStagingURL As String
Private _strSecureProductionURL As String
Private _strStreet As String
Private _strCity As String
Private _strState As String
Private _strZip As String
Private _strCountry As String
Private _dblFoundLatitude As Double
Private _dblFoundLongitude As Double
Private _boolFoundLocation As Boolean
Private _envType As envEnvironment
Private _strUsername As String
Private _strPassword As String
Private _strDataSourceName As String
Private _intNumberFound As Integer
Private _strErrorMessage As String
Private _strReturnedFormattedAddress As String
Public Sub New()
_strPublicStagingURL =
"
http://staging.mappoint.net/standard-30/mappoint.wsdl" _strPublicProductionURL =
"
http://service.mappoint.net/standard-30/mappoint.wsdl" _strSecureStagingURL =
"
https://staging.mappoint.net/secure-30/mappoint.wsdl" _strSecureProductionURL =
"
https://service.mappoint.net/secure-30/mappoint.wsdl" _strStreet = Nothing
_strCity = Nothing
_strState = Nothing
_strZip = Nothing
_strCountry = "US"
_dblFoundLatitude = Nothing
_dblFoundLongitude = Nothing
_boolFoundLocation = False
_envType = envEnvironment.envPublicStaging
_strUsername = Nothing
_strPassword = Nothing
_strDataSourceName = "MapPoint.NA"
_intNumberFound = Nothing
_strErrorMessage = Nothing
_strReturnedFormattedAddress = Nothing
End Sub
Public Enum envEnvironment As Integer
envPublicStaging = 1
envPublicProduction = 2
envSecureStaging = 3
envSecureProduction = 4
End Enum
Public Property Username() As String
Get
Return _strUsername
End Get
Set(ByVal Value As String)
_strUsername = Value
End Set
End Property
Public Property Password() As String
Get
Return _strPassword
End Get
Set(ByVal Value As String)
_strPassword = Value
End Set
End Property
Public Property ProcessingType() As envEnvironment
Get
Return _envType
End Get
Set(ByVal Value As envEnvironment)
_envType = Value
End Set
End Property
Public Property PublicStagingURL() As String
Get
Return _strPublicStagingURL
End Get
Set(ByVal Value As String)
_strPublicStagingURL = Value
End Set
End Property
Public Property PublicProductionURL() As String
Get
Return _strPublicProductionURL
End Get
Set(ByVal Value As String)
_strPublicProductionURL = Value
End Set
End Property
Public Property SecureProductionURL() As String
Get
Return _strSecureProductionURL
End Get
Set(ByVal Value As String)
_strSecureProductionURL = Value
End Set
End Property
Public Property SecureStagingURL() As String
Get
Return _strSecureStagingURL
End Get
Set(ByVal Value As String)
_strSecureStagingURL = Value
End Set
End Property
Public Property Street() As String
Get
Return _strStreet
End Get
Set(ByVal Value As String)
_strStreet = Value
End Set
End Property
Public Property City() As String
Get
Return _strCity
End Get
Set(ByVal Value As String)
_strCity = Value
End Set
End Property
Public Property State() As String
Get
Return _strState
End Get
Set(ByVal Value As String)
_strState = Value
End Set
End Property
Public Property Zip() As String
Get
Return _strZip
End Get
Set(ByVal Value As String)
_strZip = Value
End Set
End Property
Public Property Country() As String
Get
Return _strCity
End Get
Set(ByVal Value As String)
_strCity = Value
End Set
End Property
Public ReadOnly Property LastError() As String
Get
Return _strErrorMessage
End Get
End Property
Public ReadOnly Property HasError() As Boolean
Get
Return _strErrorMessage = ""
End Get
End Property
Public ReadOnly Property ReturnedAddress() As String
Get
Return _strReturnedFormattedAddress
End Get
End Property
Public ReadOnly Property FoundLocation() As Boolean
Get
Return _boolFoundLocation
End Get
End Property
Public ReadOnly Property FoundLatitude() As Double
Get
Return _dblFoundLatitude
End Get
End Property
Public ReadOnly Property FoundLongitude() As Double
Get
Return _dblFoundLongitude
End Get
End Property
Public Sub FindAddress()