Why is this WCF service not recognizing the UriTemplate parameter?

1,005

Solution 1

It turns out /sales/start={start}&end={end} is not a valid Uri (duh!). After a little trial and error I finally figured this out. Tweaking the UriTemplate with a '?' solved the problem.

[OperationContract]
[WebGet(ResponseFormat = WebMessageFormat.Json, 
    UriTemplate = "/sales/?start={start}&end={end}")]
List<Sales> GetSalesByDate(string start, string end);

Thanks for your help!

Solution 2

I know it is really late but why didn't you use the following format.

UriTemplate = "/sales/{start}/{end}"
Share:
1,005
Naik
Author by

Naik

Updated on June 23, 2022

Comments

  • Naik
    Naik almost 2 years

    I need to run the below shell script to list merges and non-merged branches in multiple repos and projects. For example

    - proj 1
       repo1    repo2    repo3
    
    - proj 2
       repo1    repo2    repo3
    
    - proj 3
       repo1    repo2    repo3
    

    Script.sh

    #!/bin/sh
    
    echo "Merged branches"
    for branch in `git branch -r --merged | grep -v HEAD`;do echo -e `git log --no-merges -n 1 --format="%ci, %cr, %an, %ae, "  $branch | head -n 1` \\t$branch; done | sort -r
    
    echo ""
    echo "Not merged branches"
    for branch in `git branch -r --no-merged | grep -v HEAD`;
    do echo -e `git log --no-merges -n 1 --format="%ci, %cr, %an, %ae, " $branch | head -n 1` \\t$branch; done | sort -r
    
  • Kevin Babcock
    Kevin Babcock about 15 years
    No, SP1 is installed. That was the first thing I checked.
  • Prakash
    Prakash about 15 years
    I don't understand why it worked on the dev box, but not on the server. But I'm glad you are unblocked!
  • Naik
    Naik about 5 years
    but here i dont have names in structured manner. the project and repositories are different different. how can we do that in these scenarios?
  • joanis
    joanis about 5 years
    If your project directories only have repos in them, and nothing else, using for repo in */* could work. If not, let me work out a solution that uses the presence of .git to detect repos.
  • joanis
    joanis about 5 years
    There, that should be a much more general solution, with a first variant for fixed depth structures and a second variant for variable depth project structures.
  • joanis
    joanis about 5 years
    Glad I could help.