wcf

MEF and WCF - Issues with AppDomain

I am currently running the latest preview (#8) and I am working with WCF services. I use MEF to read in the WCF Service Libraries. I have noticed that whenever I do any operation on one of the libraries from the application that read in the libraries, those WCF libraries have an AppDomain of 1, but whenever a WCF Service gets a notificat...

WCF security with AD functional groups

I have a WCF service running as a Windows service on intranet and I need to check that users accessing the service belong to certain AD functional groups. That is quite straightforward. I can call a method decorated with [OperationContract] that does that. However, can I enforce this check is performed each time the service is instantiat...

How are RESTful WCF services secured so that only the calling application can call them?

I have an application that uses Silverlight and ASP.NET as a front-end. It retrieves data from the server by calling some RESTful WCF services that are hosted there. I'd like to prevent the curious user from opening up a new browser window and calling the web service themselves. Is there a way to restrict access to the web services to a ...

Can Silverlight WCF client read exceptions from an ASMX web service?

I've seen no need to upgrade my services to WCF, but I have been using WCF clients for some time to access ASMX services from .NET 3.5 ASP.NET. I figured eventually I'd hit a wall in this mismatch and I just did - but with Silverlight. When using Silverlight to access ASMX web services I get an error like this in a popup : An except...

Do i *have* to use ObservableCollection in Silverlight WCF client?

When accessing Silverlight in WCF you get proxies generated with ObservableCollection Thats fine when you're databinding, but a little clumsy when you're just calling a method. For instance the following service method : [OperationContract] public SearchOrdersMsgOut SearchOrders(ShippingStatusType[] shippingStatuses, ...

What is the advantage of using DataContractAttribute over SerializableAttribute?

I have found that my WCF services work normally when the data types involved doesn't have the [DataContract], but the [Serializable] instead. But all the WCF tutorials shows the first one instead of the latter. Why? ...

Catching FaultException in WebServices

I'm calling a C# web service using the .net Service Model and occasionally this web service throws Microsoft.SharePoint.SoapServer.SoapServerException. I can catch this particular exception as a FaultException in my client code however I cannot get the friendly error message returned by the web service using FaultException. Following is...

Using WCF to consume service and receieving varying errors depending on binding configuration

I am attempting to consume an intranet web service with WCF. I added reference to the service via the Add Service Reference feature in VS2008. In doing so I was prompted for network credentials to access the service which I provided and the service reference was added. I then wrote some code that I would expect to fail as it doesn't pas...

WCF Can't Return XmlElement from XmlDataDocument.DocumentElement

Hi guys, I'm building a WCF web service which returns a composite object that looks similar to the following: [DataContract] public class WebServiceReturn { ... [DataMember] public XmlElement Results { get; set; } ... } When I return a WebServiceReturn object with the following code, e...

Get a C# Class Library to have WCF services?

How can I get a C# class library to have WCF services? I have WCF services added in there, just that I can't get it to run since it complains that the project type of Class library cannot be set as startup. Any ideas? ...

Configuring the timeout for a WCF RIA Services call from a Silverlight 3 client

I'm using the WCF RIA Services Beta with Silverlight 3.0 and I want to be able to configure the timeout from the client. I know that the underlying technology is WCF and the default timeout seems to be 60 seconds as I would expect. Is there an easy way to control this and other WCF settings? My first thought is to try the DomainContex...

Windows service start order causes faulted state in WCF Service

I have a WCF service hosted as a Windows service. The WCF service uses msmq queue on the same server. When the server is restarted my WCF service starts before the msmq service. This puts my WCF service in faulted state. What is the best way to handle this? Should I set up a dependency to the msmq service? Is there a way to handle this...

System.InvalidOperationException: An exception was thrown in a call to a WSDL export extension: System.ServiceModel.Description.DataContractSerializerOperationBehavior

can any one help me to fix this exception.... I have created service to get the country details information of various clients.. but while hosting the service i am getting this exception. i am using basic http binding. An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is: System.InvalidOperationExce...

WCF: Why does passing in a remote endpoint fail?

The problem I am having connecting a wcf client application to a host running on a separate machine is documented in a question previously asked: http://stackoverflow.com/questions/489915/wcf-why-does-passing-in-a-remote-endpoint-fail However, the solution provided here says you need to use a SpnEndpointIdentity with an empty string. S...

Persisting child deletes via NHibernate and WCF

Hi, We want to use NHibernate behind our WCF service but we are having problems persisting child record deletes to the database. We use DTO's between the service and client which have IList<> as the child collection type. When we populate a DTO using NHibernate it sets the child collection to be a type of Bag. However, when this is s...

How to do WCF Hosting in a console app?

How do I host my WCF class library in a console app? I have a WCF service within a class library and I wanted to test the service outside my project with a test app.(I have to do it outside the project) ...

Quartz .Net Job calling WCF service

Hi, What's the best way for me to call a WCF Service from within a Quartz .Net job? Is the easiest way to write a separate exe that spins up a WCF proxy and have that exe called from within the job? This seems like it would work but is a bit convoluted. It'd be nicer if I could somehow have the Job have the proxy injected in somewa...

Share private assemblies between NT service and WCF service (without GAC)

I have a WCF service (.svc) and a NT service (.exe) that need to share private assemblies (without resorting to using the GAC). Currently I have these two directory structures \MyService\service.svc \MyService\web.config \MyService\bin\privateassembly.dll An IIS virtual directory pointing to \MyService and \MyApplication\myapp.exe \...

WCF with self-signed SSL in IIS 6.0, getting strange error on client

I have a WCF service that is running on IIS 6, and must be accessed via SSL, containing a self-signed certificate. I've gone through the configuration a million times and everything look correct, but I'm getting the following error from my client app: System.Net.WebException: The remote server returned an error: (404) Not Found. ...

WCF Xml vs Binary Serialization Pros and Cons

I know that if I use binary serialization with WCF I lose interopability. If I'm willing to live with this I was wonderinf if there is an efficiency benefit in using binary over Xml. And if there are any other pros and cons that I have not mentioned above ...