user2934829
user2934829

Reputation: 687

WCF Restful service not sending response to web client

I am using MVC5, WebAPI, WCF Restful service in my web application.

When I rum WCF restful service I get mixed response. Some services gives me appropriate response and some not. I am running this application on my machine.

I used Fiddler to debug the service.

Success:

localhost/UserRestService.svc/api/GetMembership/23

Failure: localhost/UserRestService.svc/api/GetUserProfile/[email protected]

Error: [Fiddler] ReadResponse() failed: The server did not return a response for this request. Server returned 0 bytes.

I am not able to understand this error. I googled it and could not resolve this error.

Please help.

Code:

WCF Service Interface:

    [OperationContract]
    [WebGet(UriTemplate = "/api/GetUserProfile/{userName}",RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
    // UserProfiles 
    UserProfile GetUserProfile(string userName);

Fiddler raw request

GET localhost:37181/UserRestService.svc/api/GetUserProfile/[email protected] HTTP/1.1
Host: localhost:37181
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.102 Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Cookie: _gauges_unique_year=1; _gauges_unique=1; lang=auto; __RequestVerificationToken=XCXv18_vpGu9UO4wian60eLRZqUQi6_

Upvotes: 2

Views: 1403

Answers (1)

Darrel Miller
Darrel Miller

Reputation: 142242

You will need to escape the @ symbol, it has reserved meaning in a URI.

Upvotes: 1

Related Questions