|
I wrote a project myself. A class provides a method to query from the database and return a string (using the pattern developed by others, I don’t know how the data comes out, so I just use it). Now if another web application references this class and calls this method, everything is normal. But if I use a web service project, refer to this class, return the string returned from the above class as a web method, reference the web service in the web application, call the method, and "Object reference not set to an instance of" will appear. an object" error. The error output with try is
System.Web.Services.Protocols.SoapException: Server was unable to process request. --> Object reference not set to an instance of an object. 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 WSClient.RemotingServ.ServiceRemoting.GetOptionText() in C:\Inetpub\wwwroot\WSClient\Web References\RemotingClient.cs.uo1 at WSClient. TestRemoting.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\wsclient\testremoting.aspx.cs:line 58
Please master guidance. Because of business requirements, my webservice cannot directly access the database, and must get the things in the database through that intermediate class area! |
|