Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Patterns, Principles and Practices of Domain-Driven Design
This is the forum to discuss the Wrox book Patterns, Principles and Practices of Domain-Driven Design by Scott Millett; ISBN: 978-1-118-71470-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Patterns, Principles and Practices of Domain-Driven Design section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 12th, 2015, 07:09 PM
Registered User
Points: 19, Level: 1
Points: 19, Level: 1 Points: 19, Level: 1 Points: 19, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2015
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 13 - HAL Browser Update

Hi,
I typed and ran the REST API example in chapter 13 using the current version of the HAL browser. It seems that this version sets the useCredentials property to true when making its AJAX requests. So, to make the example work, I had to configure CORS on the Accounts API to support credentials, and then set the allowed origins to be the URL of the EntryPoint API (because the CORS specification won't allow a wildcard in this scenario).

To make the example work with the latest HAL browser, go to the following line of code in the Register method of WebApiConfig.cs in the Accounts API project:

var cors = new EnableCorsAttribute("*", "*", "*");

and replace this line with the following two lines of code:

var cors = new EnableCorsAttribute("http://localhost:4100", "*", "*");
cors.SupportsCredentials = true;

This should produce the same results as the code sample in the book.

Thank you very much,

Andy
Reply With Quote
  #2 (permalink)  
Old August 13th, 2015, 02:58 AM
Wrox Author
Points: 237, Level: 4
Points: 237, Level: 4 Points: 237, Level: 4 Points: 237, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2015
Posts: 59
Thanks: 1
Thanked 5 Times in 5 Posts
Default

Hi Andy,

Really appreciate that you persevered with the HAL browser and shared your findings for the benefit of other people. I will tweet your post and ask Wrox to add it to the errata amendments.

Thank you very much
Reply With Quote
  #3 (permalink)  
Old December 5th, 2015, 08:39 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Accept Header

I'm using WebApi.Hal 2.6.0 and I had to add the Accept header in order for Hal browser to work.

In particular I added the following snippet to the Custom Request Headers field in the Hal Browser:

Accept: application/hal+json.

The response is not the same using the default applicaton/json format, and Hal Browser was throwing a javascript error.

It took me a while to find out the solution. Just sharing in case somebody else is facing the same issue.

Regards
Reply With Quote
  #4 (permalink)  
Old February 11th, 2016, 05:13 PM
Wrox Author
Points: 237, Level: 4
Points: 237, Level: 4 Points: 237, Level: 4 Points: 237, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2015
Posts: 59
Thanks: 1
Thanked 5 Times in 5 Posts
Default

Thanks for taking the time to post that update. This highlights one of the difficult problems about writing a book - paper can't keep up with technology.

Thanks again and hope you enjoyed the book.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 13: Detailview doesn't Update. oceanjams BOOK: Beginning ASP.NET 4.5 : in C# and VB 2 March 20th, 2015 11:10 AM
Chapter 13 thepianoguy BOOK: Professional iPhone and iPad Application Development 3 April 6th, 2011 09:42 AM
Rolling headers (13 months) how to update records Axxess Access VBA 0 May 22nd, 2008 06:24 AM
Hey Hal ! augustine SQL Server 2000 1 August 2nd, 2004 08:57 AM



All times are GMT -4. The time now is 09:07 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.