473,769 Members | 5,900 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem in debugging a Web Service

I've written a Web Service that has main service class. Let's call the
main class that exposes the service interface as Service1.

So, we have:

public class Service1: System.Web.Serv ices.WebService
{
//code
}
I also have a business object that I am going to name BusinessObject,
for example's sake. This object is built in the service module/dll as a
class like so:
namespace BusinessObjects
{
public class BusinessObject
{

private SomeOtherClass mReferenceTypeM ember;
//the field mReferenceTypeM ember is exposed through a property
called ReferenceTypeMe mber
//code
public BusinessObject( )
{
//nothing for now
}
}
}

Note that there is only one default ctor for the BusinessObject class
and that doesn't do anything.

I compile. Build a DLL. Then I add a test project to this project. I
add a Web Reference in the Test project to point to the asmx for the
above-mentioned service. The test project and the service are both a
part of the same solution. The test project is created to test the
service.

In the test project I do,

//call the default constructor
TheAliasOfTheWe bReference.Serv ice1.BusinessOb ject bo = new
TheAliasOfTheWe bReference.Serv ice1.BusinessOb ject();

bo.ReferenceTyp eMember.SomeVal ueTypeMember = "Value";
I get an object not set to an instance exception. Reasonable!
So, I go back to the service asmx.cs file and go straight to the class
BusinessObject and modify the default constructor to do this:
namespace BusinessObjects
{
public class BusinessObject
{

private SomeOtherClass mReferenceTypeM ember;
//the field mReferenceTypeM ember is exposed through a property
called ReferenceTypeMe mber
//code
public BusinessObject( )
{
this.mRefrenceT ypeMember = new SomeOtherClass( );
}
}
}

Then, I rebuild the service.
I go to the test project. I delete the old Web Reference. I add a new
Web Reference to the same DLL (I've burnt my fingers there in not
doing that).

I insert a breakpoint at the following line

//call the default constructor
TheAliasOfTheWe bReference.Serv ice1.BusinessOb ject bo = new
TheAliasOfTheWe bReference.Serv ice1.BusinessOb ject();
in the test project.
I expect it to step through the source code in my service. It doesn't.
And it still throws the object instance set to nothing exception.

What gives?

Feb 10 '06 #1
0 1068

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

Similar topics

8
2032
by: Fabio Papa | last post by:
I am trying to write a windows service that sends emails to clients at specific times based on information in a sql db. Since this is done for multiple cities, I start a thread for each city and continue the processing from each thread. My service starts fine (gives me no errors, etc), but it doesn't seem to start the new threads. I am new to windows services, so I don't know if I'm doing something wrong. Should I maybe be doing this...
3
1859
by: David Evans | last post by:
Hi I have a service created in VS.NET, which I can install and run quite happily. After teh service is running, I can attach and run the debugger. However, if I set a breakpoint in the IDE the break point is (presumably) hit, but after a long pause there is an error that says "Source code cannot be found" I have tried:
0
1251
by: PL | last post by:
Since installing Windows 2000 Service Pack 4, I cannot debug ASP.Net projects, starting without debugging works fine. I am the administrator on the machine running IIS and VS.Net Everything was working fine before installing the service pack.
0
1323
by: Mel | last post by:
I have read the debugging document created by M.K Park (which has been referenced on this newsgroup), but unfortunately, it has not helped with solving my problem. I've spent time on the MS KB and searching Google. When I login to our domain and try to use VS.NET, I cannot debug web forms. It appears I don;t have permission to debug on the server. Debugging was working at one time, but it has since stopped working.
3
4870
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be protected by forms authentication. When I create forms authentication at root level it works but when I move my code up to the subfolder I get this error: Server Error in '/TestProjects/FormsAuthenticationTestingArea' Application.
5
4095
by: Segfahlt | last post by:
I need a little help here please. I have 2 win forms user controls in 2 different projects that I'm hosting in 2 different virtual directories. The controls have been test and operate okay in both projects. Both controls(dlls) have been signed using SN.exe and I've set up the appropriate .Net assembly permissions using those Strong Names The DLL's have been copied to the /bin directory in both web virtual directories.
0
1068
by: Innes MacKenzie | last post by:
I have an application (a .NET 2.0 windows service) which launches numerous short-lived processes (also a .NET 2.0 application). Occasionally, one or two of these processes will not run properly but instead stay running, 'just sitting there', exhibiting a number of unusual properties: Memory usage about 68K - normal .NET processes take up multi-Megabytes of memory. Process has a single thread in the Wait:Suspended state. The thread's...
3
1737
by: William LaMartin | last post by:
I have had the following happen to me for the third time in several months on my laptop but never on my desktop computer while working with a VB.et project in Visual Studio 2005. I was working with a Windows project and debugging fine. I only made a few minutes worth of changes (and did nothing to the VS setup as far as I know). Then all of a sudden, when I clicked on Debug | Start Debugging, the project build succeeded, the startup...
4
3614
by: John Wilmot | last post by:
I have a service that is set up to use remoting. Is there a way that calls from a web page to this service can be debugged in Visual Studio 2005?
0
1147
by: krystian | last post by:
Hello, I've been following the previous thread "Windows Service Starts and Immediately Stops" and I have a similar problem. I've been trying to get started on a windows service and have followed the following rather well known tutorial (I also make some references to it in this writeup):
0
10210
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10043
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9990
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8869
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3956
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.