Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, Need your help. I have created a Rest method which can take three parameters and all are empty. Here is the body.

C#
[WebGet(
 RequestFormat = WebMessageFormat.Xml,
 ResponseFormat = WebMessageFormat.Xml,
 UriTemplate = "Customer/GetAllProblemsByCityZipState/{City=null}/{Zip=null}/{State=null}",
 BodyStyle = WebMessageBodyStyle.Bare)]
public Message GetAllProblemsByCityZipState(string City, string Zip, string State)
{
    Message msg = Message.CreateMessage(MessageVersion.None, "");
    return msg;
}




I want to pass null to Zip from Client.When I am calling this method from fiddler using below URL.

http://localhost:2313/WebServices/CustomerServices.svc/
Customer/GetAllProblemsByCityZipState/1//3

the WCF service dispatcher assigning 3 to Zip instead of state as bellow
City = 1
Zip = 3
State = null

I need state Zip = null and state = 3... Could you please help me out.

Thanks in advance.
Posted

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