Tech
Forums
Jobs
Books
Events
Live
Interviews Prep
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
5
Reply
Problems in cosuming wcf Restful Service
amrish kumar
Jul 23 2015 6:39 AM
378
Reply
When Ever im trying to consume my wcf restful service with Post Method it gives Exception
The remote server returned an error: (404) Not Found.
But when i use Get Method in service it works fine.
Service
[OperationContract]
[WebInvoke(BodyStyle = WebMessageBodyStyle.Wrapped,
Method = "POST",
ResponseFormat = WebMessageFormat.Json, UriTemplate = "UserLogin/{emailId}/{password}")]
int UserLogin(string emailId, string password);
This is client application
var request = (HttpWebRequest)WebRequest.Create("http://localhost/GMTSService/GMTSService.svc/UserLogin/" + "user1"+ "passowrd");
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
Stream strm = response.GetResponseStream();
StreamReader strmReader = new StreamReader(strm);
string txt = strmReader.ReadToEnd();
Response.Write(txt);
Please Help me to resolve this.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
Wcf restful Service .and when consume it on aspx page
WCF authentication