0

I have a web service in which I created an enum.. i have a webmethod which gets the value from the enum.

  [WebMethod(Description = "testing enum")]
public string getdesctest(class1.Myenum text)
{
    class1 dt = new class1();
    string valee =dt.getenumDesc(text);
    return valee;         
       }

 public class1
   { 
  public  Myenum{ 123  ,
      [Description("123")], 
          345  
      [Description("123")], }

i am consuming this webservice, where i call the getdesctest() webmethod, can someone tell me how should i instatiate it..

i tried something like

string djf= webservice1.getdesctest(webservice1.myenum.123);

but i am getting a object reference not set.. can some one help??

John Saunders
  • 160,644
  • 26
  • 247
  • 397
helpme
  • 570
  • 1
  • 7
  • 26

1 Answers1

1

The error "Object reference not set to an instance of an object" exception is something else -- more than likely, you've not set your webservice1 variable to anything, although it is impossible to say for sure without seeing (more of) your code.

Rowland Shaw
  • 37,700
  • 14
  • 97
  • 166
  • i figured out my answer yesterday @Rowland! u were right i dint set the variable :) – helpme Mar 27 '12 at 17:28
  • When you find the answer out yourself, you can add your solution as an answer to your own question (and accept it if the question is old enough); for example: http://superuser.com/a/404582/302 – Rowland Shaw Mar 27 '12 at 17:32