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
Peter Vitt
NA
3
1.1k
wcf Service method that accepts a class parameter via POST
Jun 30 2014 5:12 PM
Hi - I'm having difficulty trying to get a WCF service method to read a class input parameter via a POST. I'm calling this method from a dojo xhr post sending JSON to the service -- I keep getting a 500 error saying unable to load the service.
My interface looks like this:
[OperationContract]
[WebInvoke(Method = "POST",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "AirVacInspectionInsert/{av}")]
String AirVacInspectionInsert(AVInspectionData av);
and my method looks like this:
public String AirVacInspectionInsert(AVInspectionData av)
{
//do something here
}
if I leave out the /av in the UriTemplate the page will load, but av is always null. Is there some trick to reading the post data? will the method not accept JSON formatted exactly like my class AVInspectionData as an input parameter? Any ideas much appreciated. I've gotten my wcf service to work fine accepting text via GET
Thanks
Reply
Answers (
1
)
Download file using WCF
Tools for debugging in WCF?