Solved

Debug ASP.NET Web Service in VB.NET

Posted on 2009-07-10
2
321 Views
Last Modified: 2012-05-07
Hello!
   I'm using Visual Studio.NET 2003, and i need to debug an ASP.NET Web Service consumed from a VB.NET application.
   To simplify things, i've wrote a VB.NET application that adds two numbers (see the attached code). To do that my application consumes a web service. I've created an ASP.NET Web Service project under the same solution as my application  (see the attached code). If i need to debug that service, haw can i do that? If i put breakpoints in service code it has no effect (they are skipped).
   Can you help me?   Thank you!
 

'APPLICATION

Imports System.Web.Services

Public Class Form1

    Inherits System.Windows.Forms.Form

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        'web reference pt. IIS    - http://localhost/AddThis/Service1.asmx

        Dim a As New localhost.Service1

        Dim x As Int16

        Dim y As Int16

        '

        x = CInt(TextBox1.Text)

        y = CInt(TextBox2.Text)

        '

        MsgBox(a.AddThese(x, y))

        MsgBox("OK!")

    End Sub

End Class
 

'WEB SERVICE

Imports System.Web.Services

<System.Web.Services.WebService(Namespace := "http://tempuri.org/AddThis/Service1")> _

Public Class Service1

    Inherits System.Web.Services.WebService
 

    Public c As Int16

    <WebMethod()> _

    Public Function AddThese(ByVal a As Int16, ByVal b As Int16) As Int16

        c = a + b

        Return c

    End Function

End Class

Open in new window

0
Comment
Question by:Cristi_E
2 Comments
 
LVL 25

Accepted Solution

by:
apeter earned 500 total points
ID: 24821953
When you hit F11 button on line number 14 , the control should step inside ur web service. Check your web service is built without errors.

Every time you change ur web service, update your web reference from VB application to ensure debugging is working fine. Also check your web reference from VB application pointing to proper web service.
0
 
LVL 14

Expert Comment

by:shahprabal
ID: 24824283
Interesting... try changing :
Dim a As New localhost.Service1
to
Dim a As New Service1
 
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now