SoapException - NullReferenceException


N

Nick

Hi there,

I have a web service running on an SSL connection and unfortunately I
can no longer invoke it, even from a test application that just calls one
method. I can see the web service definition if I browse to the asmx file,
but I can't call it. I recieve the following SoapException,

----

System.Web.Services.Protocols.SoapException was unhandled
Actor=""
Lang=""
Message="Server was unable to process request. ---> Object reference not
set to an instance of an object."
Node=""
Role=""
Source="System.Web.Services"
StackTrace:
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters) at
WindowsApplication1.MyServices.SomeService.someFunction()....bla bla bla

----

Unfortunately I have no idea what has caused this problem and even
redeploying the web service and re-creating the application in IIS7 it still
does not work. Any ideas on what could have happened here? I know this is
a very generic problem so I am greatly appreciative of any help.

Nick.
 
Ad

Advertisements

A

Alex Meleta

Hi Nick,

Look at the Event Log of the server about the error. Sure there is more information
about the issue ("Object reference not set" means that during the execution
of service some you call not initiated ref object, looks after the objects
and how you handles checking them to null)

Regards, Alex
 
S

Steven Cheng [MSFT]

Hi Nick,

As for webservice over SSL, there does exists some common issue such as the
client certificate supplyment(if you've configured it to require client
cert) or the server certificate of the SSL is not recognized at client
side. Since the "Null Reference" exception is quite a general one, I think
it would be better to do more tests before we look further into it:

** You can turn off SSL and access it through normal http to see whether it
works.

** As you mentioned that you can visit the asmx page via webbrowser, is
there any warning or error when you visit it through webbrowser? Some
warning (that can be suppress interactively) may cause exception when we
access it programmtically

**As Alex suggested, Eventlog is also worth checking for any useful clues.

If you have any other findings, also welcome to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
From: "Nick" <[email protected]>
Subject: SoapException - NullReferenceException
Date: Tue, 20 May 2008 19:30:55 +0100
Hi there,

I have a web service running on an SSL connection and unfortunately I
can no longer invoke it, even from a test application that just calls one
method. I can see the web service definition if I browse to the asmx file,
but I can't call it. I recieve the following SoapException,

----

System.Web.Services.Protocols.SoapException was unhandled
Actor=""
Lang=""
Message="Server was unable to process request. ---> Object reference not
set to an instance of an object."
Node=""
Role=""
Source="System.Web.Services"
StackTrace:
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClien tMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters) at
WindowsApplication1.MyServices.SomeService.someFunction()....bla bla bla

----

Unfortunately I have no idea what has caused this problem and even
redeploying the web service and re-creating the application in IIS7 it still
does not work. Any ideas on what could have happened here? I know this is
a very generic problem so I am greatly appreciative of any help.

Nick.
 
N

Nick

Hi Alex,
Look at the Event Log of the server about the error. Sure there is more
information about the issue ("Object reference not set" means that during
the execution of service some you call not initiated ref object, looks
after the objects and how you handles checking them to null)

Unfortunately there is nothing in the event log for this error. Also, I
can replicate this in a 3 line app,

1. Instantiate
2. Call << this line fails with the
SoapException, even though the object has been instantiated
3. Display return value

Even if I get the error to occur 10 times in a row, nothing appears in
the event viewer. Cheers for your time, I'll keep cracking at it.

Nick.
 
N

Nick

Hi Steven
As for webservice over SSL, there does exists some common issue such as
the
client certificate supplyment(if you've configured it to require client
cert) or the server certificate of the SSL is not recognized at client
side. Since the "Null Reference" exception is quite a general one, I
think
it would be better to do more tests before we look further into it:

** You can turn off SSL and access it through normal http to see whether
it
works.

Okay, well, I know that the SSL certificate is fine, if that helps as the
error page that I am redirected to has the same certificate as it's on the
same sate, and IE says it's all okay. Also I have previously had the issue
with an invalid certificate and know this to not be the case.
** As you mentioned that you can visit the asmx page via webbrowser, is
there any warning or error when you visit it through webbrowser? Some
warning (that can be suppress interactively) may cause exception when we
access it programmtically

Nope, I can just view the page fine. If I try and invoke it through the
browser I get redirected to a 500 error, internal server error.
**As Alex suggested, Eventlog is also worth checking for any useful clues.

Unfortunately there is nothing in the Event Viewer for this error, do I
have to enable something in order to see more detailed information?

Cheers for your time, I'm still cracking at it.

Nick.
 
N

Nick

Aaah! I just kinda answered my own question, it turns out the 500 error is
down to the first line of code causing an exception. Multiple developers
working on the same project, somehow the web.config file has been mixed up
and the connection string wasn't there!

Thanks a million for your time! *spam*
 
Ad

Advertisements

N

Nick

All sorted now Alex, it was a problem with the web.config file and a
missing connection string! of all things *mumbles*

Thanks a million for your time.
 
Ad

Advertisements

S

Steven Cheng [MSFT]

Thanks for your reply Nick,

I'm glad that you've figured out the issue. Yes, sometimes we may encounter
some problem that is caused by unexpected changes which will be a bit
difficult to locate through general approachs :)

If you need any further help in the future, welcome to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top