Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

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)

Posted

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

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)

Posted

OOphs, forgot about that little word. It should work now, thanks for the help.

 

Mike55

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)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...