Questions tagged [uritemplate]

80 questions
2
votes
1 answer

WCF UriTemplate UrlEncode

Imagine I want to call a external (meaning I have no control over the contract) REST service using WCF. I have the following contract [ServiceContract] public interface ISomeRestApi { [OperationContract] [WebInvoke(Method = "PUT",…
Stif
  • 903
  • 11
  • 21
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
  • 10,149
  • 6
  • 29
  • 40
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
  • 4
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
  • 6,337
  • 11
  • 51
  • 73
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,505
  • 7
  • 28
  • 50
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,710
  • 2
  • 17
  • 33
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
  • 20,024
  • 18
  • 75
  • 125
1
vote
2 answers

How to bind parameters in Micronaut controller in Kotlin?

See code in gist: https://gist.github.com/C06A/e80b783a1d34cc9d80e339da0d7b5b53 This is a small sample project I try to make with Micronaut in Kotlin. Unfortunately the only parameters binding I was able to do as in the code. They require the…
C.A.B.
  • 465
  • 4
  • 12
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,251
  • 1
  • 25
  • 40
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,780
  • 5
  • 38
  • 64
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
  • 39,070
  • 21
  • 110
  • 151
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
  • 15,480
  • 3
  • 61
  • 91
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
  • 2,383
  • 1
  • 32
  • 44