Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / August 2005

Tip: Looking for answers? Try searching our database.

First Web Service - Having Problems

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Allen McGuire - 20 Jul 2005 17:46 GMT
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" %>

Signature

A McGuire

--
A McGuire

François Lemaire - 22 Jul 2005 10:32 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.