.NET Framework Bookmark and Share   
 index > ASMX Web Services and XML Serialization > Returning Custom Object From WebService
 

Returning Custom Object From WebService

Hi All,

I am returning custom object as below from my service. Client will be consuming it through Java platform.

I am using all primitive datatypes here. Still, could there be any compatibility issues?
Is there any more information I need to provide except WSDL for client to be able to consume this service?
What are the best practices in such a scenario??


/// Summary description for Service1
/// </summary>
//[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class Service1 : System.Web.Services.WebService
{
[WebMethod]
public Employee GetEmployee()
{
return new Employee();
}
}
[Serializable]
public class Employee {

private string firstName;
public string FirstName {
get { return firstName; }
set { firstName = value; }
}
private string lastName;
public string LastName
{
get { return lastName; }
set { lastName = value; }
}
}


Thanks.
ExpertSoul
There will be no issues, and there's nothing else to provide.
John Saunders
Use File->New Project to create Web Service Projects
Use WCF for All New Web Service Development, instead of old ASMX or obsolete WSE
John Saunders
There will be no issues, and there's nothing else to provide.
John Saunders
Use File->New Project to create Web Service Projects
Use WCF for All New Web Service Development, instead of old ASMX or obsolete WSE
John Saunders

You can use google to search for other answers

Custom Search

More Threads

• Getting error details from xmlReader, but not as a single string
• Recieving error when using XmlSerializer
• Item has already been added. Key in dictionary:
• halt a databind in progress?
• Referring custom wsdl in webservice
• What's a inactive connection or client?
• How To Display HTML in XSL Style Sheet
• language problem
• What's happened to WebServices in .net 3.5
• What happened to Designed Components