Solved

Debug ASP.NET Web Service in VB.NET

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

863 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

19 Experts available now in Live!

Get 1:1 Help Now