Click here to Skip to main content
15,905,073 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when i am Execute my service below error occuring

UriTemplateTable does not support multiple templates that have equivalent path as template '/TasteList?TokenNo={TokenNo}' but have different query strings, where the query strings cannot all be disambiguated via literal values. See the documentation for UriTemplateTable for more detail.


the code are below :

C#
[OperationContract(Name = "GetAllTaste")]
        [WebInvoke(Method = "GET", UriTemplate = "/TasteList?TokenNo={TokenNo}", BodyStyle = WebMessageBodyStyle.WrappedRequest,
                    RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        TasteModel[] TasteList(string TokenNo);

        [OperationContract(Name = "GetClosestTaste")]
        [WebInvoke(Method = "GET", UriTemplate = "/TasteList?TokenNo={TokenNo}&Latitude={Latitude}&Longitude={Longitude}&Distanse={Distanse}", BodyStyle = WebMessageBodyStyle.WrappedRequest,
                    RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        TasteModel[] TasteList(string TokenNo, string Latitude, string Longitude, string Distanse);

        [OperationContract(Name = "GetTasteByLocation")]
        [WebInvoke(Method = "GET", UriTemplate = "/TasteList?TokenNo={TokenNo}&EncryptedLocationID={EncryptedLocationID}", BodyStyle = WebMessageBodyStyle.WrappedRequest,
                    RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        TasteModel[] TasteList(string TokenNo, string EncryptedLocationID);

        [OperationContract(Name = "TasteList")]
        [WebInvoke(Method = "GET", UriTemplate = "/TasteList?TokenNo={TokenNo}&EncryptedLocationID={EncryptedLocationID}&Latitude={Latitude}&Longitude={Longitude}&Distanse={Distanse}", BodyStyle = WebMessageBodyStyle.WrappedRequest,
                    RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        TasteModel[] TasteList(string TokenNo, string EncryptedLocationID, string Latitude, string Longitude, string Distanse);
Posted

See this link: http://stackoverflow.com/questions/23049915/uritemplatetable-does-not-support-multiple-templates-that-have-equivalent-path-a.


Try to change the beginning of the UriTemplate of each operation to point to the appropriate path. (Instead of /TasteList use: /GetAllTaste, /GetClosestTaste, etc...)

 
Share this answer
 
hi Shmuel Zang
Thanks for the solution, but i sorted it using another technique that is :
I used post method.


C#
[OperationContract(Name = "TasteList")]
        [WebInvoke(Method = "POST", UriTemplate = "/TasteList",
                   RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        TasteModel TasteList(TasteModel model);
 
Share this answer
 
Comments
Member 12165147 14-Mar-16 0:50am    
but through POST method it is not displaying data in browser.

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