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

First Web Service - Having Problems

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\VisaVal idator\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.BasicPr ofile1_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" %>

--
A McGuire
--
A McGuire
Nov 23 '05 #1
4 2801
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.BasicPr ofile1_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

"Allen McGuire" wrote:
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\VisaVal idator\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.BasicPr ofile1_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" %>

--
A McGuire
--
A McGuire

Nov 23 '05 #2
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.

--
A McGuire
"François Lemaire" <Fr************@discussions.microsoft.com> wrote in
message news:A6**********************************@microsof t.com...
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.BasicPr ofile1_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

"Allen McGuire" wrote:
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\VisaVal idator\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.BasicPr ofile1_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" %>

--
A McGuire
--
A McGuire

Nov 23 '05 #3
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
Nov 23 '05 #4
Ignore the last post.
Chapter 04 works fine now!

Hiran
Nov 23 '05 #5

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

Similar topics

7
by: Lalit | last post by:
Hi Friends, I have developed a Windows service. Now i need icon for this service in systray and context menu fo this icon. Can i do this? With regards, Lalit
3
by: invinfo | last post by:
After having MySQL 3.23 installed, I upgraded to 5.0, but having problems with the service. I did not do a full uninstall and its not clear, if I should have or not. However as many Windows...
0
by: Ross Bennett | last post by:
Ahoy, Folks! I've been looking all over for this, but I just can't seem to shake any documentation out of the MSDN or from Google. I've reviewed every .NET article on developing Windows...
4
by: Keith | last post by:
I'm in the same boat as the fellow who posted this message back in August: Title : Windows Service, How does one make a service "fail" properly? Author : Ross Bennett Group :...
3
by: todd_groten | last post by:
Alright, I've been searching around for some time and have not been able to find anything concrete on fixing an issue I am having. Here's the situation: 1) I have a non-anonymous webservice...
3
by: Andi Twine | last post by:
Hi all, I really hope someone here can help ! I have designed and built an ASP.NET web service with Visual Studio .NET. The web service outputs some dummy XML data when its called with some...
0
by: myoungbl | last post by:
Note:I'm using VB.NET, .NET 2.0, to write a service application. So far I've only attempted to run it on the development machine. I'm have a couple of problems I can't quite figure out with a...
3
by: Derek Hart | last post by:
As a newbie to Windows Service programming in VB.Net, I need some clarification. I am writing a Windows Service that works with SQL Server. It works fine as a console application, but when I run it...
13
by: dancer | last post by:
I have made a new post because when I try to respond to another, I get the error, "Article Rejected -- Ill-formed message id" This is in response to the advice of Juan Libre to install Net...
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....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.