helpme
helpme

Reputation: 570

webservice enum

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??

Upvotes: 0

Views: 679

Answers (1)

Rowland Shaw
Rowland Shaw

Reputation: 38130

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.

Upvotes: 1

Related Questions