Questions tagged [uritemplate]

80 questions
2
votes
1 answer

In WCF can I have a wildcard character in a literal segment of my UriTemplate?

I am authoring a RESTful WCF service using .Net 4.0. I want the following two URLS: /root/document/{ids}?fields={fields} /root/externaldocument/{ids}?fields={fields} to map to the same interface member: Documents GetDocuments(string ids, string…
Joe Alfano
  • 9,669
  • 6
  • 26
  • 39
2
votes
0 answers

Validity of a uri template according to URITemplate specification

Is '/abc/foo/{id}/bar/*' a valid template according to URITemplate specification? Or the url s with only {} are valid? i.e. /abc/foo/bar/{path}. In the first case, /abc/foo/4/random/new.jgp will be mapped to /abc/foo/{id}/bar/* In the second case,…
Sameera
  • 143
  • 3
1
vote
1 answer

WCF Interoperability with other services, content type is text/html

I am trying to create a WCF client that operates with an http rest endpoint not based on Microsoft technologies. My WCF-foo is pretty weak, so I don't understand what I am doing incorrectly... I've created a service contract that looks like…
tbischel
  • 5,931
  • 10
  • 47
  • 71
1
vote
3 answers

URI Template variable containing a path?

I have a question about URI template variables. I need to manage an URI with the form: http://netlocation:port/application_path/{variable} the variable can be a path itself, i.e. something like this/variable/is/a/path so that the complete URI…
MaVVamaldo
  • 2,425
  • 5
  • 26
  • 48
1
vote
1 answer

UriTemplate Wildcard to match Uri fragments with spaces in WCF WebGet method

I'm using a UriTemplate wildcard to match the whole URI string after the path to a WCF svc: [WebGet( UriTemplate = "feed/{*path}" )] However this only matches up until the first space (or '+' or '%20'), is it possible to get it…
Alastair
  • 1,480
  • 2
  • 16
  • 30
1
vote
1 answer

Is it possible to change the UriTemplate at runtime

I have the following WebInvoke Attribute: [OperationContract] [WebInvoke( Method = "POST", UriTemplate = "", BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat =…
user280610
1
vote
1 answer

WebInvoke with UriTemplate with empty strings

How does the WebInvokeAttribute and UriTemplate resolver behave when supplied with empty strings in placeholders at runtime? The documentation doesn't seem to cover this. In some inherited code, I'm getting situations where the methods are not being…
Jason Kleban
  • 18,057
  • 15
  • 68
  • 116
1
vote
1 answer

REST WCF Service - Consume QueryString Parameters

I have this REST WCF service. [WebInvoke(UriTemplate = "/GetNames/{Category}?order=asc", Method = "POST", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)] public List GetNames(string Category) { //Code to…
Sidharth
  • 1,191
  • 1
  • 21
  • 39
1
vote
1 answer

JAX-RS Path annotation URI template

I have this code method in a java class with JAX-RS: import javax.ws.rs.GET; import javax.ws.rs.HeaderParam; import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import…
1
vote
2 answers

Retreive WCF query parameters as a single string

I need to define a WCF GET method which can retrieve all the query parameters as a single string. Example: https://xxx.xxx.xxx.xxx/token?client_id=abc_def&client_name=&type=auth&code=xyz I want to grab the string…
user3573403
  • 1,558
  • 1
  • 29
  • 52
1
vote
2 answers

How can I use strongly typed parameters in the uri path in WCF with WebHttpBinding

Okay, I've searched a bunch for answers to this question and I can only seem to find articles and documents for .NET 3.5 from 2011 and back... so I'm hoping to find more recent information for WCF in .NET 4.5 (and up). I've got a WCF service that is…
BenAlabaster
  • 36,299
  • 19
  • 100
  • 147
1
vote
0 answers

Can RFC 6570 URI Templates encode space separators for optional parameters?

I'm working with the US Census API (examples), in which there are optional parameters, which are space-separated. I needed a general-purpose URL templating mechanism, and Google led me to RFC 6570 and its implementations. But as I understand it,…
Ed Staub
  • 14,730
  • 3
  • 55
  • 86
1
vote
2 answers

Wrong rest service is selected

i have resource with two methods: @GET @Path("/{date}") public Response getPartnerInteractionsByDate( @PathParam("partnerId") int partnerId, @PathParam("date") String date ); @GET @Path("/{interactionId}") public Response…
Zavael
  • 1,948
  • 1
  • 26
  • 38
1
vote
1 answer

Complex routing WSO2 API resourse uri template

Short Version. I am trying to create a API that will handle /goals/risks /goals/types /goals/{goalID} So far this is what I have but it isn't quite what I am looking for. as it gives me /goals/goal/{goalId}
Jegsar
  • 419
  • 5
  • 19
1
vote
1 answer

unlimited number of Path Variables in the form of one URI template

my existing code is below: @RequestMapping(value = "/{id}/{type}/{answer}", method = RequestMethod.GET) @ResponseBody public Results answer(@PathVariable("id") int questionId, @PathVariable int type, @PathVariable Boolean answer) { …