Solved

Debug ASP.NET Web Service in VB.NET

Posted on 2009-07-10
2
327 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

773 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