Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 19th, 2015, 10:05 PM
Registered User
 
Join Date: Mar 2015
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 10 How to run WCF from web site

I have desktop with Windows 8.1 Pro x64 (upgraded from Win 8 Pro) and installed Visual Studio 2003 express for Web (yesterday I installed community edition). I created a simple WCF service as was written in the book (I found on Internet similar solution) but I received this error:

Code:
Error: Cannot obtain Metadata from http://localhost:58696/WebServices/NameService.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.  For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error    URI: http://localhost:58696/WebServices/NameService.svc    Metadata contains a reference that cannot be resolved: 'http://localhost:58696/WebServices/NameService.svc'.    There was no endpoint listening at http://localhost:58696/WebServices/NameService.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.    The remote server returned an error: (404) Not Found.HTTP GET Error    URI: http://localhost:58696/WebServices/NameService.svc    The HTML document does not contain Web service discovery information.
I tried to find a solution but I did not find anything. At first I thought that I wave problems with my computer but I found out this example

http://mikesknowledgebase.azurewebsi...ment-949587244

I tried before steps #1-#5 and I could test WCF.

I even tried Programs & Features .NET framework 4.5 advanced features - WCF - HTTP activation and target to .NET 4.0 but no way. Thank you for your help. I am novice in Web Development and I would appreciate any suggestions.

I suggest that it is necessary to change something in web.config. Otherwise it is only chance to create a separate WCF project and set reference to compiled WCF???

Last edited by UriF; March 19th, 2015 at 10:42 PM..
 
Old March 20th, 2015, 10:08 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

How are you viewing the service and where do you get this service? I just created a new empty web site, add a service, right-clicked the .svc file and chose View in Browser and then it works for me.

Is the code in the correct place (in App_Code) and did you save all your changes?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old March 20th, 2015, 09:41 PM
Registered User
 
Join Date: Mar 2015
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I created a new empty web site. Then I added a new item - web service. I did not add any new code (default method). Vs2013 automatically created a .cs (I use C#) file. Then I selected this file and pressed F5. I see a progess bar that try to add a service. After progress bar reached approx 50% (or 60%) progress bar disappeared and I see above mentioned message.

I tried this clean experiment after I tried to run service (I tried to run samples from chapter 1 to chapter 10 in the same web site). Of cource .cs file appeared in the folder App_Code.

Sorry, do you use Win7 or Win8? I even opened "Program & Features" and under Win Components IIS checked HTTP activate (I am not at home now; hence I do not remember how exactly it named). I even tried to add settings from the above mentioned WCF/Jason project. No result... I understand that something wrong with IIS or VS settings but I spent more than 6 hours on Internet and I was surprised - a lot of people have this problem with Win8 but never had problems with Win7

Thank you again

Last edited by UriF; March 20th, 2015 at 09:50 PM..
 
Old March 21st, 2015, 10:32 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Don't hit F5 to run the service as it'll open itself in the WCF Test Client. Instead, right-click it and choose View In Browser. That should work, and you should see the screen from the book. The service should work just fine when called from client side script.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old March 23rd, 2015, 10:42 AM
Registered User
 
Join Date: Mar 2015
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you. I did it and everything is fine





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 10 run WCF from web site UriF BOOK: Beginning ASP.NET 4.5.1 : in C# and VB 1 March 19th, 2015 10:14 PM
Unable to run code chapter 9, 10, 13 ttdevelop BOOK: Professional Android 2 Application Development 17 December 7th, 2012 05:14 PM
Chapter 10, p382, Custom WCF Service, step 8 peterkao87 BOOK: Beginning SharePoint 2010 Development 0 December 5th, 2011 08:31 AM
Chapter 10 - Setup instructions for the SampleWebService at companion web site dbaechtel BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 0 August 24th, 2009 07:33 AM
How to run the chapter 10 (acegi) sample code? dleal BOOK: Professional Java Development with the Spring Framework 0 June 28th, 2006 10:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.