wcf

Strange Component Registration error with Castle Windsor WcfFacility

Hi, I'm trying to convert my existing site to use WCF to communicate with my services on another box. Currently I use auto-registration to wire-up my services directly. When I try to use the WcfFacility of Windsor I get a ComponentRegistrationException on one of my interfaces that I'm trying to register. The error is below, it only h...

How can I change the default configuration for WCF?

I have WCF Client initialized like this MyServiceClient client = new MyServiceClient(); so it uses the app.config to read the endPoints. I would like to dynamically change the default config file to a file I define. I know I can open a configuration file like this: Configuration myConfig = ConfigurationManager.OpenExeConfiguration ...

List<Customer> all or nothing.

I am creating a webservice using Windows Communication Foundation (WCF) and I currently don't know what the best way to do validation with it is. I have two methods: CreateCustomer(Customer) and CreateCustomers(List<Customer>). If a client passes in a list of customers, and some of the customers are invalid, should I reject the enti...

c# (wcf) architecture file and directory structure (and instantiation)

Hello and thanks for any assistance. I have a wcf service that I'm trying to properly modularize. I'm interested in finding out if there is a better way or implementing the file and directory structure along with instanciatation, is there a more appropriate way of abstraction that I may be missing? Is this the best approach? especial...

How to Bind a WPF control to a WCF method using an ObjectDataProvider

I'm testing out WPF for the first time and I'm trying to call a WCF service with an ObjectDataProvider. WCF Service named WcfService1 with a single method: namespace WcfService1 { public class Service1 : IService1 { public String HelloWorld() { return "Hello World!"; } } } I added a S...

Why can't I serialize an object using DataContractSerializer?

I'm trying to serialize a type using the DataContractSerializer and am getting the exception below. This isn't for an SOA service, but I would still like to use the DataContractSerializer if possible. I am using .Net 3.5 SP1. Type 'System.DelegateSerializationHolder+DelegateEntry' with data contract name 'DelegateSerializatio...

Data annotations on WCF service contracts

I have a WCF service that has a [DataContract] class defined in it. Each of the properties has the [DataMember] attribute and I have added a couple of Data Annotation attributes [Required] and [StringLength] to a couple of the properties. I then consume this service in an asp.net MVC application as a service reference. When I get a list...

WCF Inheritance/Polymorphism and Serialization

I have a class, ReportDef, which is a concrete class that I've decorated with [DataContract] and [DataMember] attributes as needed. ReportDef is in assembly A1 along with my ServiceContract, IReportService. I then have another class, UiReportDef, which derives from ReportDef and is in assembly A2. UiReportDef has no additional state t...

Error HRESULT E_FAIL has been returned from a call to a COM component

Hi Geeks, I dont know what is going on with this "Error HRESULT E_FAIL has been returned from a call to a COM component.". Do you guys know what happened? My wcf service was running fine, but today I got this error. I searched on google but no answers could be found. Thanks in advance ...

Best way to document WCF interface?

So I'm using WCF, and want to document my interface(s) and services to give to another company for an internal app. What's the best way to document those interfaces? I'd prefer having the documentation inline with the code, and then have something prettify to output HTML, but am not sure if there's a recommended way to do it. Thanks....

How to unit test a WCF Client built with WCF Rest Starter Kit

I created some POX services using the REST Starter kit. At first, it was a little complicated to create the unit tests for the service layer, but in the end, it was well designed and I succeed in mocking the context and set expectations. But, I'm starting in with the client side now, and I'm having some problems figuring out how to mock...

How to add xsl stylesheet node to XML produced by XmlSerializer?

I have an WCF REST service which returns objects serialized with XmlSerializer. How can I add XSL stylesheet information (like the one below) to the output returned by the WCF service? <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="transforms/Customer.xsl"?> <Customer> <Name>Foo</Name> </Customer> My...

Do WCF Services Expose Properties?

Hi, In the interface required to implement a WCF service, I declare the main class with the [ServiceContract()] attribute and any exposed method with [OperationContract()]. How can i expose public properties? Thanks ...

wcf json web service

What is the best way to create a JSON web service? We have another team that is using Java and they insist to having all communication done using JSON. I would prefer to use WCF rather than any 3rd party framework. I found this blog: http://www.west-wind.com/weblog/posts/164419.aspx, and it suggests that the Microsoft implementation is ...

Having DataContractSerializer serialize the same class in two different ways?

I'm using the DataContractSerializer to serialize an objects properties and fields marked with DataMember attributes to xml. Now a have another use case for the same class, where I need to serialize other properties and other fields. Are there a way to add "another DataMemberAttribute" that can be used for my other serialization scena...

WCF project with this sample leads to errors - VS 2008

The sample is from here: link text I built the sample project and it build with no errors. But click on F5, I get message that the service has been hosted and then it throws this error AppName: wcfsvchost.exe AppVer: 9.0.622.1152 ModName: mscorwks.dll ModVer: 2.0.50727.3082 Offset: 00080012 ...

Weird port being reported in WCF for remote client

I have a IIS hosted WCF service that is configured with a WebHttpBinding. It is the same default WCF service VS2008 creates when you create a new one. The only changes I have made is to allow it to be called from javascript. In the test method GetData(int value), i return a string that displays the remote clients IP address, port, and ...

Excel with Reporting Services via WCF

Hi there, What is the best way of using Excel as the client for reporting services via WCF? I would like to do something along the lines of Excel calling a WCF service which sends back the URL of where the report is on the reporting server and then displays it. How would I go about this? What excel add-on, if any, do I need and how ca...

wcf and ADO entity framework

Hi We are using Linq to Entities in WCF service. We created a edmx file which contains auto generated entities. While creating proxy the entities are not appearing in the proxy class even the data contract and datamember attributes are there. We found that the problem is because of the auto generated entities are inheriting from somethi...

Continuous rapid calls to WCF service returns a " Only one usage of each socket address (protocol/network address/port) is normally permitted 127.0.0.1:10111

Hey guys. I have developed a little mashup site. This site is complete with a community. So when the user goes to the Community.aspx page he/she will see the members of the community with joined date,nuber of comments, name, etc.etc. and ofc paging as well. There are like 15 users per page. Now my problem is that i have 2 types of users ...