wcf

C# WCF: When is it appropriate to use the KnownType attribute?

Hi all, I'm curious about the KnownType attribute, and when to use it--I'm not terribly clear, after reading the MSDN reference. So yes, the attribute communicates type information to the serializer, but when is this needed? Is it appropriate when the class being serialized has references of a base class type, and there are up-cast deri...

Howto read service endpoint name from inside service implementation

I am hosting several endpoints under same service host, which implement same service contract. I need to start different business layer based on the endpoint name, so is there a way I get endpoint name inside my service implementation constructor? Basically, as a service I need to know which endpoint I was started under. ...

How to connect a C++ COM To a WCF Service

Hello all, I'm looking to a way to connect a COM+ legacy application to a WCF Service, i have been researching this since a couple of days and i haven been lucky to find any useful information, can anyone point me into the right direction on this? I Need the old COM+ component to make calls to a new C# WCF Service so I Need some kind of...

How can I find out if a Web service is running or not?

I want to check availability of web service. this is my code that i running a function from web service DataSet ds = new DataSet(); DataTable dt = new DataTable(); NegsoNotifier.WorkItemsService.WorkItemsSoapClient wiservice; wiservice = new NegsoNotifier.WorkItemsService.WorkItemsSoapClient(); System.ServiceModel.EndpointAddress adr; ...

How to debug Validate(...) function at server side?

I am using wsHttpBinding with custom username authentication. Thus, I had override Validate(string userName, string password) function of the UserNamePasswordValidator class. My Validate(...) like this: public override void Validate(string userName, string password) { if (userName.Equals(string.Empty) || password.Equals(stri...

What does "OperationContext.Current.GetCallbackChannel" actually do?

What does OperationContext.Current.GetCallbackChannel actually do? How does it identify each and every client? I'm facing a problem in my WCF service. If more than two users get connected to the service all the "interesting Changes" i'm sending from service to the clients are going to the second joined user. For ex, If A, B, C, D joins...

WCF can only serialize parameters on development machine

Hello, I have created a WCF service using vb.net. Everything works fine on my development machine but when I deployed it it failed with the following error 'There was an error while trying to deserialize parameter http://tempuri.org/:querys' I call a single method on the service and it has a single parameter called 'querys'. This pa...

WPF & WCF relationships

I heard that WPF is more suitable than WinForms for working with WCF. Is it true, and if so, why? ...

Cryptic "Access is Denied" exception from WCF service

I have a secure WCF service with custom authentication. When I am stress testing it - having a few dozens of clients connect at the same time, I often get the following exception in my server-side logs: System.ServiceModel.FaultException: Access is denied. at System.ServiceModel.Dispatcher.AuthorizationBehavior.Authorize(MessageRpc& ...

Entity Framework 4.0 - Can I send a complex type to the client over WCF ?

Hey, can anybody confirm the following scenario will work: I am developing a 3-tier application in .NET 4.0: Winforms Client, aspx server and SQL 2008 database. The server communicates with the SQL 2008 database by means of Entity Framework 4.0, and returns the entities in forms of STE's (in a separate assembly) to the client applicati...

How to handle xs:any in WCF Data Contract

scratching my head on WCF ... I've got XML messages where the children of could be anything, e.g. <Test1Root> <CaseNo></CaseNo> <Activity></Activity> <DataFields> <AccountRef></AccountRef> <PropRef></PropRef> <User></User> </DataFields> </Test1Root> I've handled this in BizTalk using the xs:any for the <xs:...

What is the domain name when using ActiveDirectoryMembershipProvider against ADAM (AD LDS)

Ok, I've come a long way in my quest to authenticate WCF invokers against AD LDS, right now I have ActiveDirectoryMembershipProvider set up so that even the VS2010 Project/ASP.NET configuration tool allows me to create and edit AD LDS users, and does so using a Secure connection (so no username/password needed in web.config), so far so g...

WCF Error - Could not find a base address that matches scheme...

I'm trying to get a WCF web service to work with SSL, as you can imagine it works on my machine, however when I run it on the production environments I get this instead: Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https]. Despite many h...

ASP.NET MVC with ADO.NET DataServices

In the project i am working on, i want to use the ADO.NET data services as data access layer. so that other parts of my application (except asp.net mvc web site) could also access it from the same location. I am just not sure if this si the correct model and also for asp.net mvc models I wanted to reuse the data services model, as much a...

Exposing existing class library to WCF service

Hi guys, I have an existing class library with all the classes to communicate with my server. I've created a WCF service that will be hosted on my existing server as part of different application domain. Since I already have the classes I thought it can be exposed on my WCF service to lessen my development time. I successfully hosted m...

Where should WCF / WebSerices reside in a Silverlight application?

I'm looking for best practices on where to host associated Webservices/WCF Services for Silverlight applications. One approach I see quite often is to host these services in the same web application project that is used to host the silverlight application. This seems convenient because it unions the two pieces together. However, with ...

What is the difference between ServiceBehavior and CallbackBehavior in WCF?

What is the difference between ServiceBehavior and CallbackBehavior in WCF? and also between contract and a behavior. ...

Using the WCF DataContractJsonSerializer in .NET 3.5

I'm trying to use the geocoding code from here in my ASP.NET MVC 2 site. Unfortunately, some of that code, specifically the DataContractJsonSerializer usage, is only possible through .NET 4.0. As my hosting provider doesn't support .NET 4, I'm forced to implement that functionality in .NET 3.5. How can I rework the code (which I have re...

Implementing IErrorHandler using class level Attributes in WCF

Had no luck with getting it working via config files, so decided to attempt to go the more robust route of doign it via class level attributes. If I can get this working it is clearly a great way of wrapping exceptions in Faults in the service layer withou trepeating lots of code. However the code in the attribute never seems to get run...

Best practice for inserting and querying data from memory

We have an application that takes real time data and inserts it into database. it is online for 4.5 hours a day. We insert data second by second in 17 tables. The user at any time may query any table for the latest second data and some record in the history... Handling the feed and insertion is done using a C# console application... Ha...