You are here: Blog Zone
 Register    Login 
Blogging .Net Minimize  

Author: Tim Wheeler Created: 6/6/2008
A blog for all WCF related topics.

By Tim Wheeler on 7/17/2008

I was trying to Unit Test my WCF Service, and for some crazy reason Visual Studio 2008 would issue a stop command to the IIS Admin service and the World Wide Web Publishing service, right before the unit test called the wcf service.  As VS had cleverly stopped the services hosting my WCF service, the call subsequently failed with:

 Test method [method] threw exception:  System.ServiceModel.EndpointNotFoundException: Could not connect to http://localhost/WcfService/v1/MyService.svc. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:80.  --->  System.Net.WebException: Unable to connect to the remote server --->  System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:80.

Found nothing to help me understand why VS behaved this way.  I found that if the WCF project was unloaded the unit test would succeed.  Interestingly enough a college was having another issue with WCF not using the proxy settings defined in the config.  And found a good link about why here: http://blogs.infosupport.com/porint/archive/2007/08/14/Configuring-a-proxy_2D00_server-for-WCF.aspx

Originally I thought this may have been a similar cause, then my college found that turning off code coverage solved the problem.  Open your localtestrun.testrunconfig and remove the code coverage checks. But now I'm not so sure as I still have the issue.  

By Tim Wheeler on 7/9/2008

I was trying to pass an XmlNode as a parameter in my WCF Service.  Didn't think this would be an issue but I kept getting the error:

Type 'System.Xml.XmlNode' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.

I found a like on what types you can use with the DataContractSerializer here: http://msdn.microsoft.com/en-us/library/ms731923(VS.85).aspx

So it support only an Array of XmlNode, WHAT?! Ok, fine so then we use XmlElement instead, or pass in an array with 1 item. 

Search Minimize  

Archive
<February 2012>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910
Monthly
July, 2008
Code Artist.net v1.1 Minimize 

Code Artist.net released!  

With a simple to use interface your .net web sites will be showing professional looking source code in minutes.

Your Code, Your Format - Code Artist presents code like it’s meant to be seen.

More...


DotNetNuke Hosting Minimize  

Need professional DotNetNuke hosting from as little as $10 per month?  Contact Us for all your DotNetNuke needs with a package to suit everyone.  Our services include:

  • Free Base Setup
  • Free Premium Modules and Skins
  • Offsite Backup
  • High Availability > 99.5%
  • SSL Certificates
  • Business Portals from $500
  • Professional Help and Support

Enquire here about DotNetNuke Hosting.


 Copyright 2008 PureCoding.net
 Terms Of Use     Privacy Statement