wcf

In WCF, can data contract classes inherit from one another?

In a WCF service, I have two classes with the [DataContract] attribute. One of these classes has an "is-a" relationship with the other - so class B can inherit from class A. However, when I configure inheritance between these two classes, both denoted with a [DataContract] attribute, the metadata fails to load when testing the services...

WCF REST parameters cannot contain periods?

So here's a super simple interface for doing rest in WCF. [ServiceContract] public interface IRestTest { [OperationContract] [WebGet(UriTemplate="Operation/{value}")] System.IO.Stream Operation(string value); } It works great, until i try to pass a string with periods in it, such as a DNS name.....

How would a php or java client authenticate if I'm using WCF w/ forms auth?

I have a generic proof of concept WCF service that is using forms authentication to secure access. All works great when my client is .NET (vb code below) Dim client As SupplierServiceClient = New SupplierServiceClient() client.ClientCredentials.UserName.UserName = "[email protected]" client.ClientCredentials.UserName.Password = "password"...

Using WCF in a new project... is it feasible?

The company that I work for develops a C++ application to manage service businesses (dispatching, GPS tracking, CRM, etc). The problem is that the system is a little too limited. Being a relatively small company, we'd like to broaden the horizons and add some more modern features such as a web interface and plugins for various other appl...

Update all WCF Service References in one click (two clicks would be OK too!)

I have multiple projects containing multiple WCF service references. My WCF services are in a state of flux so I frequently have to go around and update all of my service references. Is there a way to achieve this as a single action? ...

Upload and download large files - Windows Mobile (Compact Framework) via Web Services (WCF, MTOM, WCE?)

Hi all, I have searched quite a bit and can't seem to find a good stable solution, so any help will be appreciated. Here's the scenario: Windows Mobile device running client app on .NET CF 3.5 (OpenNETCF libraries being used) Web App on .NET 3.5 (Web server running IIS) Developing in VS2008, .NET 3.5 - all the latest I need to use web...

does WCF's NetTCPBinding supports Socks Proxy?

I've got a client/server WCF application I want to deploy in a corporate environement. They usually don't allow direct Internet connections, so I must use their SOCKS proxy. Is it possible to use the netTcpBinding channel over a socks proxy? ...

Identical Types In Separate Web Services

I have a similar problem as this question. I have multiple web services that I am consuming with WCF, which all share types. The services themselves are written in Java and I do not have access to them. The shared types have the same signatures, but svcutil.exe gives this error when running: Error: There was a validation error on a sche...

Multiple simultaneous saves cause WCF/NHibernate "Row updated by another transaction"

I am working on a large application that manages complex 'events' with quite a bit of data. The application is broken into a client (C# mainly .NET 2.0 mainly), a WCF based server made to run on IIS (web services at this layer), and a data back end that is NHibernate based with an MS SQL Server database backend. We are encountering a b...

How do I reuse complex types accross different services?

I have 2 separate java services that use a complex type that is a exactly the same but takes an email object as a parameter like: class Email{ Description{get;} Address{get;} } The services look something like this: emailBasketBallTeam(email); emailTennisTeam(email); Is there a way that I can specify a contract for the em...

How do I add a CSS stylesheet to a WCF generated RSS feed?

I have a WCF service that uses a System.ServiceModel.Syndication.SyndicationFeed to create an RSS feed. But I'm having trouble figuring out how to add a Processing Instruction to output that points to my CSS stylesheet. What I need is a processing instruction that looks a bit like this: <?xml-stylesheet type="text/css" href="http://y...

Is it possible to read request headers from WCF IDataContractSurrogate implementation?

I have a RESTful service that I am developing in WCF. I am exposing a contract that does not have serializable types so I am using a DataContractSurrogate (implementation of IDataContractSurrogate) to create surrogates that can be serialized with the DataContractSerializer. My question is, how can I access request/response headers in m...

DataContractSerializer: preserve references

Hi, Just a question of curiosity. When i preserve object refernces while serializing an object graph with DataContractSerializer the xml emitted where there are refrences looks like this: <test z:Ref="1" and i:nil="true" /> Can anybody tell me why it says i:nil="true" here? Why not just the reference? ...

WCF System.ServiceModel.Security.SecurityNegotiationException

I am getting the following error message when trying to call my service from another server. Service cannot be started. System.ServiceModel.Security.SecurityNegotiationException: The caller was not authenticated by the service. ---> System.ServiceModel.FaultException: The request for security token could not be satisfied because authent...

WCF UserName Authentication: Can I get the Username in a custom ServiceAuthorizationManager?

I have a WCF service that is using a custom ServiceAuthorizationManager. The custom auth manager is already set up to handle Windows and Forms authentication. However, if I connect with a client that is set to UserName auth, I can't seem to find the username anywhere. The client code looks like this: this.ClientCredentials.UserName.Us...

WCF ServiceHost basicHttpBinding 503 error

Hi all, I'm trying to run a WCF ServiceHost as an NT Service on a Windows 2007 SP1 Server. The ServiceHost is reponsible for hosting a single service endpoint: a basicHttpBinding with the following address: http://localhost:5555/ToBlah When I run this ServiceHost on my local machine (Windows XP), it works fine - when I POST a SOAP ...

"Cannot load the X.509 certificate identity specified in the configuration"

I transfered a workking WCF service from my development environment to the QA environment, including the certificates (Root Authority, Root Auth revocation list, Service certificate - including its PK). Afterward I located the private key usihg 'FindPrivateKey' and gave all the relavent accounts full permissions to access the private ke...

How to make sure you dont get WCF Faulted State Exception?

I am getting this exception "The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state" The WCF service uses the default wsHttpBinding. I am using WCF in the following way wherever I am using it - using (var proxy = new CAGDashboardServiceClien...

How can I force unhandled exceptions in a WCF thread to crash the process?

So here's the scenario: I have a WCF service that has a bunch of FaultContracts defined per operation. I would like to arrange it such that if an unhandled exception is thrown in a WCF service thread that does not match a valid FaultContract, it takes down the entire process rather than just the thread. (The reason being that I would ...

WCF consumed as WebService adds a boolean parameter?

I've created the default WCF Service in VS2008. It's called "Service1" public class Service1 : IService1 { public string GetData( int value ) { return string.Format("You entered: {0}", value); } public CompositeType GetDataUsingDataContract( CompositeType composite ) { if ( composite.BoolValue ) ...