karthik
karthik

Reputation: 459

ASP.NET webservice

I have written a webservice class with 1 web method("InsertPerson") which takes an argument of another public class(Person, for ex) object( That Person class defined as public in that service class page itself).

Code:

Class Service1 : Webservices
{

 [WebMethod]

    public bool InsertPerson(Person p)
    {
        return true;
    }
}

public class Person 
{

    public Person()
    {
    }
    public string PersonName;
    public int Age;
}

Now in my client, before i invoke that webmethod "InsertPerson", i just wanted to create object for person class but i cannot find that..

That Person class from service not exposed, Could you please help on this.

Upvotes: 0

Views: 132

Answers (1)

Waqas
Waqas

Reputation: 6812

did you tried using [Serialize] attribute to your Person class?

Upvotes: 1

Related Questions