Hi All,
I have great problem Om web Service Plz Help me
My code lines are:-
1. My dll Code
Class Employee
{
Public EmployeeeId
{
get{}
set{}
}
Likewise ..........
}
Class Users
{
Public UserId
{
get{}
set{}
}
Likewise ..........
}
2. My service Code has web method.....
[WebMethod]
public Object[] GetID(string str, int i, ............, Object objData)
{
.
.
.
.
.
.
..
return objData;
}
This objData is of any type depending on my dll class
3. WebSite Code
when call from my website by adding references of this serice
Like
Object obj = new Employee();
Service proxy = new Service();
Object[] objGet = proxy.GetId(string str,.........., obj);
same as User class
but it throws exception "cannot XML Document"
So these are my lines of code Plz help how can i pass user definrd object to this generic Object
vigneshwarPosted Jul 13, 2008, 11:31 PM
Thanks Dear for your reply
but this is specific to a class i have to make generic for all classes. In my dll there is 150 classes so this method is called by every class that's why i will take generic object
So plz help but again thnks for previous reply.
Satish KathiPosted Jul 11, 2008, 11:40 AM
Create object class which you are passing as parameter in web service with in the web service dll
And when calling the web service create an Instance of the object and send as parameter
1. Your dll Code
Class Employee
{
Public EmployeeeId
{
get{}
set{}
}
Likewise ..........
}
Class Users
{
Public UserId
{
get{}
set{}
}
Likewise ..........
}
public class Dept
{
//Your code goes here
}
2. Your Web service Code
[WebMethod]
public Object[] GetID(string str, int i, ............, Dept dp)
{
.
.
.
.
.
.
..
return objData;
}
3. When calling web service create Dept object
webservicereference.Dept dpt = new webservicereference.Dept();
webservicereference.Service proxy = new webservicereference.Service();
Object objGet = proxy.GetId(string str,.........., dpt);