Help!! How to consume WCF Service using Java Server Page

Posted by Techbee under WCF on 5/30/2010 | Views : 4704 | Status : [Member] | Replies : 1
I am new to WCF, I have created a WCF service that will to be consumed by a JSP page. The WSDL file has been generated and added to the JSP client but I have just got to a point where I feel I could benefit from some consultations after having spent days trying to get it to work. I am hoping to just display a set of records from an access database that is accessed through WCF service. Could you please help me to achieve this functionality. I have provided my code for the WCF service.

My WCF Code is as follows:

System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WCFCarService
{
[ServiceContract]
public interface ICarService
{
[OperationContract]
List<Car> GetCars();
}

[DataContract]
public class Car
{
private int carID;
private string carMake;
private string carModel;
private string carTransmission;
private string carBodyType;
private int yearManufactured;

[DataMember(Order = 1)]
public int CarID { get { return carID; } set { carID = value; } }

[DataMember(Order = 2)]
public string CarMake { get { return carMake; } set { carMake = value; } }

[DataMember(Order = 3)]
public string CarModel { get { return carModel; } set { carModel = value; } }

[DataMember(Order = 4)]
public int Year { get { return yearManufactured; } set { yearManufactured = value; } }

[DataMember(Order = 5)]
public string CarTransmission { get { return carTransmission; } set { carTransmission = value; } }

[DataMember(Order = 6)]
public string CarBodyType { get { return carBodyType; } set { carBodyType = value; } }
}
}




And my Implementation is as follows:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WCFCarService
{
public class CarService : ICarService
{

#region ICarService Members

public List<Car> GetCars()
{
List<Car> carList = new List<Car>();

return carList;
}

#endregion
}

}





Responses

Posted by: Deeraj on: 6/4/2010 [Member] Starter

Up
0
Down
Hi TechBee,

I understand your immediate necessity to get it working. However, I guess most of the members here are associated with MS technologies if not all.

However, take a quick look at similar question and discussions here, http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/4c5d88fb-5427-4024-aef1-94b601745dd1

Hope that helps!


Techbee, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response