wcf

WCF integration testing in TeamCity

I want my integration tests to run on each commit in TeamCity. What is the good way to get my WCF service running automatically for the tests? WCF service is part of the solution that is tested. Currently I self-host the service in the tests. host = new ServiceHost(typeof(...), url); But I can't apply my actual IIS configuration file...

My WCF service works fine on a Windows 7 Enterprise machine but fails when hosted on windows server 2003 (Same Code)

We have been using a Windows 7 Enterprise machine for development and we have 7 wcf services.... All of them worked fine in the development machine... When we hosted the same services in Windows Server 2003 and IIS 6, we are facing a couple issues... One of the services is throwing a "An existing connection was forcibly closed by the rem...

Trying to follow WCF delegation example on MSDN but keep getting "impersonation level" exception.

Near the bottom of this article (MSDN) in a section entitled "The following code example demonstrates how to use delegation." where MSDN shows an example of how to perform delegation. I have tried to take this example and apply it to my code. In my situation, I have a client app (WCFTestClient), a middle service and a back end service....

What can WCF WebHttp do that ASP.NET MVC cannot?

Please, no "They solve 2 different problems" answers, it's the same HTTP request and response problem. Just because you have views/templates in MVC doesn't mean you have to use them. M_C is good enough for serving XML and JSON. Please, no "It's what Microsoft says you should do" answers. If I thought that way I wouldn't be asking this q...

Securing MVC Rest + Soap Service with a single key strategy

I have an asp.net MVC 2 site setup to provide an API json/xml responses eg [GET] /Product/10 Returns an xml response of a product Additionally, I have a WCF SOAP service embedded into the site which returns the same methods (same contract) but via SOAP eg GetProduct(10) Returns an xml soap product. I chose this route because I li...

Documenting WCF Web Services

I would like to create/generate documentation from (somewhat)RESTful WCF Services. By somewhat RESTful I mean the client will use HTTP GETs and HTTP POSTs to communicate with the server (limited to just these verbs due to hardware limitations) I like the way Twitter released their documentation: http://dev.twitter.com/doc/get/statuses/u...

C# WCF - Publisher/Subscriber Pattern: Displaying Data On Multiple Forms.

Scenario So I've taken an example of a distributed application in WCF that implements the Observer pattern. Ihave put the server-side into a windows service and added some classes to do some calculations, which I intend to pass the results back to the client. The solution is made up of 3 projects. Server-Side Windows Service - Pro...

How to test a WCF endpoint using WCF Test Client

When I run up WCF Test Client, I only see two "endpoints" in a system - BasicHttpBinding_MyService and WSHttpBinding_MyService. Now the system accepts a multitude of different types of request, and these are passed into the endpoints in an array of Requests (Request[]) (as far as I can tell). This seems fine, but it is non-obvious how ...

How do I do set the Authorization header of a GoogleLogin request using the new WCF REST HttpClient API

I'm using the new HttpClient class, part of the WCF REST Starter Kit, to authenticate to Google's Map Data service. I've got my ClientLogin authentication token, but I'm not sure how to take this instruction: GET http://maps.google.com/maps/feeds/maps/userID/full Authorization: GoogleLogin auth="authorization_token" and make...

How does WCF turn a ServiceContract/OperationContract into a Message that can be serialized?

I'm starting to experiment with using ActiveMQ (in conjunction with the ActiveMQ.NMS bindings) to support some cross platform RPC messaging that we're looking at doing. As part of this I'd like to be able to define our RPC contracts in the manner WCF provides - eg. [ServiceContract] public interface IUsers { [OperationContract] ...

Custom membership provider and current endpoint

I am writing custom membership provider for my WCF application and I need to know current endpoints URL in ValidateUser() method. How can I get this information about current channel that is used? I have checked OperationContext, WebOperationContext and HttpContext. They are all null. TIA Mijalko ...

Which C# data types are not WCF serializable?

We have C# entity classes which map to some of our SQL Server database tables. We need to be able to serialize these classes in order to send them back to the client, from the server, via WCF. For each SQL Server data type, we have a corresponding C# CLR data type in the associated entity. We have some SQL Server data types, such as Im...

How to specify a parameter of an OperationContract as required

Hi, I wonder how I can specify a parameter of an OperationContract method in WCF as required so that the generated xsd contains minOccurs="1" instead of minOccurs="0". Example: [ServiceContract(Namespace = "http://myUrl.com")] public interface IMyWebService { [OperationContract] string DoSomething(string param1, string p...

WCF Web Service Metadata Publishing Disabled Error

I modified my web.config to add a custom binding in order to increase the buffer and message size, and it seems like in creating the service element explicitly, it has somehow broken the reference to my behavior element. When I try to run my web service from VS using the WCF Test Client, or I go to the service page, I get the error: M...

WSE3 - WCF Interop

Hi guys, I need to provide a WCF Service capable of suply data to old .Net clients (WSE) vía SSL and using signed messages for non repudiation porpuoses. Can any one give me a hint about configurations and architectures on both sides? For the service: bindings? Security modes? For the client: Policies? Tokens? thanks! ...

Store And Replay WCF Messages

Hi all, I want to store WCF messages in some storage and read them later on in order to "replay" them again. Attached some code parts: private void WriteMessage(Message message, string path) { FileStream fileStream = new FileStream(path, FileMode.Create); using (XmlDictionaryWriter writer = XmlDictionaryWriter.CreateBinaryWriter...

Windows authentication on intranet in a RESTful WCF service

My goal is to create a RESTful HTTP API (most likely hosted in IIS) to be used within a company's intranet that hosts Windows machines. The RESTful API will be created using WCF. Consequently, the WCF binding type is webHttpBinding. Fundamentally, the API consists of various resources e.g. http://domain/service1, domain/service2, etc, e...

Setting WCF DataContract namespace using ContractNamespace attribute

In designing my service, I decided that I wanted to customize the namespaces that appeared in the resulting WSDL. For the DataContracts, i came across the ContractNamespace attribute which seemed a nice shortcut alternative to setting the same namespace explicitly for every DataContract. My initial attempt looked like this: [assembly:C...

IIS module and WCF

I have written an IIS module (base IHttpModule) that does some custom (OpenAuth) authentication before preceding to my WCF REST service. I have extended GenericPrincipal to track my user, with an IIdentity, and set the context.User field to my new principal: application.context.User = principal However, when I receive the context in WC...

web service getting started

Hi all I have to implement a web service in my work, the problem is that I don't have any idea what a web services is. Can you give me some references to get started and to understand what people are asking me for? Maybe some good book also ... Thanks. ...