SoapException - NullReferenceException

Discussion in 'ASP .Net Web Services' started by Nick, May 20, 2008.

  1. Nick

    Nick Guest

    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.
     
    Nick, May 20, 2008
    #1
    1. Advertising

  2. Nick

    Alex Meleta Guest

    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
     
    Alex Meleta, May 20, 2008
    #2
    1. Advertising

  3. 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:
    .

    ==================================================
    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" <>
    >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.
    >
    >
    >
     
    Steven Cheng [MSFT], May 21, 2008
    #3
  4. Nick

    Nick Guest

    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.
     
    Nick, May 21, 2008
    #4
  5. Nick

    Nick Guest

    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.
     
    Nick, May 21, 2008
    #5
  6. Nick

    Nick Guest

    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*

    "Nick" <> wrote in message
    news:Ovfq4%...
    > 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.
    >
     
    Nick, May 21, 2008
    #6
  7. Nick

    Nick Guest

    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.

    "Nick" <> wrote in message
    news:%...
    > 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.
    >
     
    Nick, May 21, 2008
    #7
  8. 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:
    .

    ==================================================
    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.

    --------------------
    >From: "Nick" <>
    >Subject: Re: SoapException - NullReferenceException
    >Date: Wed, 21 May 2008 09:55:14 +0100


    >
    >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*
    >
    >"Nick" <> wrote in message
    >news:Ovfq4%...
    >> 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.
    >>

    >
    >
    >
     
    Steven Cheng [MSFT], May 22, 2008
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Flare

    Inherit from soapException

    Flare, Oct 23, 2003, in forum: ASP .Net
    Replies:
    9
    Views:
    2,358
    Kevin Spencer
    Oct 24, 2003
  2. Marty McDonald

    SoapException - unusual behavior

    Marty McDonald, May 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    679
    Marty McDonald
    May 19, 2004
  3. =?Utf-8?B?RGFueQ==?=
    Replies:
    3
    Views:
    683
    =?Utf-8?B?RGFueQ==?=
    Dec 3, 2004
  4. djmc
    Replies:
    1
    Views:
    1,998
  5. Jerry Q

    SOAPException and Browser

    Jerry Q, Jan 16, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    322
    Jerry Q
    Jan 16, 2006
Loading...

Share This Page