views:

46

answers:

4

System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Web.Services2.WebServicesExtension.AfterSerializeServer(SoapServerMessage message)

Above exception is thrown whenever i try to access any method of webservice on another machine.

Regards, Muhammad Waqas

+1  A: 

Muhammad, I don't know what's causing your problem because you didn't show us the area of code where the exception comes from in your code.

However, it's clear that you are using WSE2. Were you aware that WSE2 is very obsolete? You should not use WSE at all unless you have no choices at all.

You should use WCF for all web services work; certainly for all new web services work.

John Saunders
A: 

After serialize event takes place when the SOAP payload is successfully serialized from the client.

I am guessing there might be some issue with the web service method rather than your code.

Aseem Gautam
A: 

Muhammad, Could you please give us some more specifics? Are you saying that whenever you access any web service that is not located on your machine you get this error? Or are you saying that you have a web service on your machhine that you cannot access from another machine? Also, how are you hosting this web service? IIS, Apache, your own soon-to-be-released replacement for all web servers everywhere?? And, as John Saunders said before, where in the code is the exception coming from?

From what you've written, my first hunch is a permissions issue, but some more details would greatly help.

John Norcott
A: 

I think I was unable to make clear my question so i should explain it in detail. Actually i have to copy a zip file from remote machine to my machine through code and in my company there is already a webservice written to get a copy of zip file as attachment and now i have to call that webservice's specific methods for my solution and that webservice is deployed at the system from where i have to copy that file but now when i tried to call method of webservice it throws an exception "Client found response content type of ", but expected 'text/xml'. The request failed with an empty response"

Muhammad Waqas