Errata

RESTful .NET

Errata for RESTful .NET

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Other Digital Version Ex 2-3
Example 2-3

without the following line of code before "return response;", the response won't contain the custom header:

response.Properties[HttpResponseMessageProperty.Name] = responseProp;

Brook Richan  Aug 08, 2012 
Printed Page 14
Figures 1-3, 1-4, 1-5

Figure 1-3 Client: The HTTP request should read
"GET/users HTTP/1.1" instead of "GET/usersHTTP/1.1"

Figure 1-4 & Figure 1-5:
The service content in both examples appears identical (except for foo.com/bar.com) but the Content-Length is 120 (Fig 1-4) and 116 (Fig 1-5). Shouldn't the Content-Length be identical in these two examples? (I think they should both be of length 116)

Alex Dangelo  Apr 12, 2009 
Printed Page 28
4th paragraph, under WebGetAttribute and WebInvokeAttribute

Two new operation behaviors that are applied as attributes on a ServiceContract's methods that already are operations because they have the OperationContractAttribute applied.

I believe "are applied" is the verb in the sentence, and the word "that" which precedes it is an error.

Dorothy Rifai  Aug 12, 2009 
Printed Page 44
First code snippet

The UriTemplate in the code snippet doesn't match the URI listed in option (b).

Option b is:
http://example.org/search?q=Don%20Box

The example shows:
UriTemplate search = new UriTemplate("/search={y}");

The UriTemplate should instead be:
UriTemplate search = new UriTemplate("/search?q={query}");

(Note: Changing {y} to {query} would also show consistency with the IBioTaxService interface in Example 3-1 for Search()).

Alex Dangelo  Apr 12, 2009 
Printed Page 44
Last paragraph before the "Summary" heading

The first few paragraphs on page 44 describe two different approaches to RESTful endpoints for searching. The last paragraph about those approaches appears to be talking about an Add() example instead of a search example.

The printed text reads:
"Again, both options will accomplish the same thing (that is, route the request to the Add method and pass both x and y to the method), but the QueryString version just feels better because x and y aren't part of the resource...".

The replacement text probably should not refer to "x and y" or the "Add" method, and use "q" instead of "y" in the following example:
Printed: UriTemplate search = new UriTemplate("/search={y}");
Change to: UriTemplate search = new UriTemplate("/search={q}");

and then update the text to:
"...route the request to the Search method and pass q to the method), but the QueryString version just feels better because q isn't part of the resource..."

Alex Dangelo  Apr 12, 2009 
Printed Page 47
Paragraphs 3 and 4

"OperationContextAttribute" is listed but it should be "OperationContractAttribute".

These are the sentences with the typo:
"... using the normal WCF constructs of ServiceContractAttribute and OperationContextAttribute..." (paragraph 3)

"...definition that already has the OperationContextAttribute..." (paragraph 4)

Alex Dangelo  Apr 12, 2009 
Printed Page 48
Example 3-1

In the GetDomain() method in the IBioTaxService contract, the variable name case needs to match the UriTemplate (should be uppercase 'D').

Printed:
[WebGet(UriTemplate = "/{Domain}")]
Message GetDomain(string domain);

Expected:
[WebGet(UriTemplate = "/{Domain}")]
Message GetDomain(string Domain);

Alex Dangelo  Apr 12, 2009 
Printed Page 75
Tip section at top of page

In the sentence "This means that anything you do with code will overwrite whatever is in the configuration file."

In this sentence, the code doesn't "overwrite" the configuration file contents, rather the code "will override whatever is in the configuration file."

Replace the word "overwrite" with "override".

Bill Craun  Aug 15, 2009 
Printed Page 81
Last paragraph

I think the numbers of the examples referenced are off by two.

The text reads "..shows the earlier "robust" open and close cases from Examples 5-4 and 5-5...".

Example 5-4 shows what not to do to manage the ServiceHost lifetime, and 5-5 is about adding base addresses.

The text should instead refer to "Examples 5-2 and 5-3".

Alex Dangelo  May 04, 2009 
Printed Page 90
Near the bottom of Example 5-13

The HTML comment start tag in Example 5-13 is missing a "-".

Printed:
<!-this is for the service that is inside ...

Expected:
<!-- this is for the service that is inside ...

Alex Dangelo  Apr 12, 2009 
Printed Page 96
Example 5-18

The RestModule which is considered as "one potential implementation" causes a problem with files in subfolders.

To reproduce the problem, create a website or web project with .css, .js or image files that are located in subfolders name css, script or img and reference those files from an .html file.

The files won't have any effect on the web site as they are effectively filtered out by appending an ".svc" to the subfolder part of the uri.

To solve the problem one could put the relevant parts of the module into an if (!System.IO.Path.HasExtension(path)){} block, but this approach will again cause problems if you use the advanced .Net 3.5 SP1 UriTemplate with file extensions (as suggested on page 130).

In such a case I think the whole concept of filtering out the .svc file extension has to be reconsidered (perhaps whitelisting/blacklisting some extensions or something else I can't think about).

Anonymous  Jan 28, 2009 
Printed Page 160
Paragraph after Example 8-1

A backslash character ("\") is used in the description but it should be a forward slash ("/").

Printed:
Since the service's UriTemplate value is \, it will...

Expected:
Since the service's UriTemplate value is /, it will...

Alex Dangelo  Apr 12, 2009 
Printed Page 166
Tip section at top of page

In the tip section at the top of the page an enumerated value of WebHttpSecurity.TransportOnlyCredential is used. This is not a valid value. The correct enum value should be WebHttpSecurity. TransportCredentialOnly.

Replace WebHttpSecurity.TransportOnlyCredential with WebHttpSecurity.TransportCredentialOnly.

Bill Craun  Aug 16, 2009 
Printed Page 220
Paragraph above Example 11-3

I think there is an extra "is" in the sentence below:

Printed:
Example 11-3 is shows the OutgoingWebResponseContext...

Something like this may sound better:
Example 11-3 shows the OutgoingWebResponseContext...

Alex Dangelo  Apr 12, 2009