mike55 Posted August 12, 2004 Posted August 12, 2004 Hi After running into a problem with a reference to a web service. The steps i took in creating the web service were as normal, file->add new project->web service (renamed to Classification.aspx). Inorder to use the methods i created in the web service i put the statement <webmethod()> before the start of the method. I then went to my front end project and added a web reference and left the name that the system game me (localhost in this case). In my code i then went Dim x as new localhost.Classification. Now in my code when i typed x.methodname, the methods in my web service was ok, however when i actully run the project and try to call the web service methods for the frontend i get the following error: Object reference not set to an instance of and object. Any suggestions. This is the same proceedure i have used in previous projects and it worked. Mike Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
Administrators PlausiblyDamp Posted August 12, 2004 Administrators Posted August 12, 2004 (edited) Is the error being raised by the client or the server? If possible could you post the code from the client and maybe the server methods that are failing - or do all the server methods fail? Edited March 30, 2007 by PlausiblyDamp Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
samsmithnz Posted August 12, 2004 Posted August 12, 2004 Have you trying placing some breakpoints and stepping through it? Quote Thanks Sam http://www.samsmith.co.nz
mike55 Posted August 12, 2004 Author Posted August 12, 2004 Ok, Firstly in relation to the breakpoint and stepping through the code, had already done that prior to running this posting. My code is as following: Dim x as localhost.classification The front-end code. Global Variables: Dim temp as string private sub btnDelete_click(byVal sender as object, byVal e as System.EventArgs) Handles btnDelete.click if (Session("access") = "") then if (txtRef.text = "") then lblWarning1.visible = true 'Missing data else temp = txtRef.text x.delete(temp) end if else lblWarning2.visible = true 'You do not have permission to access resouce end if end sub The webservice code. Nameof webservice = classification Global variables: dim answer as string <WebMethod()>public sub delete(byVal value as string) if temp <10 answer = "over" else if temp >10 answer = "less" end if end sub From stepping through the code, it would seem that the problem lies with the front end. Oh yea all server methods are failing. Mike55 Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
Administrators PlausiblyDamp Posted August 12, 2004 Administrators Posted August 12, 2004 try Dim x as New localhost.classification Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
mike55 Posted August 12, 2004 Author Posted August 12, 2004 OOphs, forgot about that little word. It should work now, thanks for the help. Mike55 Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.