TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
kl baiju
NA
53
0
Error using xml
Apr 7 2011 9:08 AM
Hi this is my wcf application
[ServiceContract]
public interface IService1
{
[OperationContract]
IEnumerable<Department> depts();
// TODO: Add your service operations here
}
//implementation
public class Service1 : IService1
{
public IEnumerable<Department> depts()
{
XDocument xdoc = XDocument.Load(HttpContext.Current.Server.MapPath("Dept.xml"));
IEnumerable<Department> depts = from p in xdoc.Descendants("Department")
select new Department
{
Name = p.Element("Id").Value,
Dept = p.Element("Dept").Value,
};
return depts;
}
}
//testing wcf in a web application
protected void Page_Load(object sender, EventArgs e)
{
ServiceReference1.Service1Client dd = new ServiceReference1.Service1Client();
GridView1.DataSource = dd.depts();
GridView1.DataBind();
}
this is the error
object reference not to set instance of an object
Reply
Answers (
0
)
REST in WCF: Error 405 (Method not allowed) when communicating between services
WCF Service Application throwing error after deployment