Any ideas would be great - I hope I provide enough information here. I'm getting a bit frustrated - I'm a newbie in the .NET programming arena.
Full Error returned from VWD 2005 Express Beta:
Error 1 Could not create type 'VisaValidator.CreditCardValidator'. c:\inetpub\wwwroot\XMLWebServices\Chapter3\VisaValidator\Validation.asmx 1
Environment: Windows XP SP2 with local IIS and other prerequisites. I confirmed by getting 'Hello World' example to work.
Code (Validation.vb):
Imports System.Web.Services
Imports XMLWebServicesStepByStep.CreditCardValidator
<WebService(Namespace:="http://localhost/", _
Name:="VISAValidator", _
Description:="A service to validate VISA card numbers.")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
Public Class CreditCardValidator
Inherits System.Web.Services.WebService
<WebMethod(Description:="Validate a VISA card number.")> _
Public Function _
ValidateVISACard(ByVal p_card_number As String) _
As Boolean
Try
Return New Validator().ValidateVisa(p_card_number)
Catch x_ex As System.ApplicationException
Return False
End Try
End Function
End Class
Code (Validation.asmx):
<%@ WebService Language="vb" CodeBehind="~/App_Code/Validation.asmx.vb" Class="VisaValidator.CreditCardValidator" %>
If I read your code well, the codebehind file declared in the Validation.asmx
file is Validation.asmx.vb and the file you gave us is named Validation.vb.
I'm not familiar with VB.NET, but it seems also like you do not declare the
CLR namespace of your CreditCardValidator class (which should be
VisaValidator based on your asmx file, since the Class attribute is
VisaValidator.CreditCardValidator). You should type the following :
Imports System.Web.Services
Imports XMLWebServicesStepByStep.CreditCardValidator
Namespace VisaValidator
<WebService(Namespace:="http://localhost/",Name:="VISAValidator",Description:="A service to validate VISA card numbers.")>
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
Public Class CreditCardValidator Inherits System.Web.Services.WebService
<WebMethod(Description:="Validate a VISA card number.")>
Public Function ValidateVISACard(ByVal p_card_number As String) As Boolean
Try
Return New Validator().ValidateVisa(p_card_number)
Catch x_ex As System.ApplicationException
Return False
End Try
End Function
End Class
End Namespace
Hope this helps
Regards
François
> Any ideas would be great - I hope I provide enough information here. I'm getting a bit frustrated - I'm a newbie in the .NET programming arena.
>
[quoted text clipped - 26 lines]
> Code (Validation.asmx):
> <%@ WebService Language="vb" CodeBehind="~/App_Code/Validation.asmx.vb" Class="VisaValidator.CreditCardValidator" %>
Allen McGuire - 22 Jul 2005 14:06 GMT
Considering my code was right out of the book - I feel the need to write the
author on this one ;-)
You hit the nail on the head my friend. Since I'm learning from a book
called XML Web Services, one would think they would guide me in the right
direction!
Again, my sincere thanks.

Signature
A McGuire
> If I read your code well, the codebehind file declared in the
> Validation.asmx
[quoted text clipped - 68 lines]
>> <%@ WebService Language="vb" CodeBehind="~/App_Code/Validation.asmx.vb"
>> Class="VisaValidator.CreditCardValidator" %>
Hiran de Silva - 08 Aug 2005 00:33 GMT
Allen,
I had no problem with Chapter 03. Are you still stuck?
I do have a problem where the VisaValidator.vsdisco file was not created by
VS.NET 2003. I think this is causing a problem for me in Chapter 04 -
Building a SOAP Client when adding a web reference.
Hiran
Hiran de Silva - 08 Aug 2005 23:07 GMT
Ignore the last post.
Chapter 04 works fine now!
Hiran