Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

We have written code for fetching member psw using wcf technology with json code shown below

service1.svc.cs code
---------------------

C#
public string GetMemberPassword(string surname,string email)
        {
           
                string result = cl.GetMemberPassword(surname, email);
                return result;

        }



and Iservice1.cs code
--------------------------

C#
[OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "/GetMemberPassword/{surname}/{email}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        string GetMemberPassword(string surname, string email);


Problem is when we type url http://localhost:2330/Service1.svc/GetMemberPassword/srini/srini@gmail.com[^]

it is giving error " The resource cannot be found. that is http 404"
how we can pass email id in wcf service url please anybody help out us


Regards
Sangamesh Arali
Posted
Updated 7-Jun-12 0:59am
v2

The problem is most likely with the web server that you are using to serve up the files. Cassini is known to have a problem with multiple dots in the URL. You can easily resolve this by switching to IIS Express. I just wrote an article on how to do that. It only takes a couple minutes (just read the opening couple sections - the rest is just advanced stuff) and I think it will fix your problem.

Here is a link to my article:

Make Web Development Easier with IIS Express[^]

And here is a link to the Stack Overflow question that talks about your issue:

http://stackoverflow.com/questions/8491159/email-address-as-part-of-a-wcf-data-service-querystring[^]
 
Share this answer
 
This probably wont help and the suggestions by Tim is good, but sometimes you may want to actually modify the HTTP headers passed to the WCF service. You could then inspect the headers and obtain custom information such as email addresses.

An interesting article is Add Custom Message Header in WCF 4 Calls[^]

Another way (but probably a poor but dirty way) would be to replace all "." (dots) in the email with the character "~" (squiggle) and then in the service replace the "~" (squiggle) with "."'s. Again these approaches are probably not "best practice" but there are ways to skin a cat!!!
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900