wcf

Duplex Contract GetCallbackChannel always returns a null-instance

Hi! Here is the server code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ServiceModel; using System.Runtime.Serialization; using System.ServiceModel.Description; namespace Console_Chat { [ServiceContract(SessionMode = SessionMode.Required, CallbackContr...

Any XmlSerialization Limitations in WCF (as opposed to DataContract)?

Is there anything I might regret later, i.e. any major limitations if we choose XmlSerialization instead of DataContract? Until now, we have embraced the schema first contract design. For example, if we want to parameter inspection, security enhancements, etc... will locking in now with XmlSerialization be a problem when we try to add...

WCF service - HTTP500

Hi guys, I need help with wcf service. i have a ajax-enabled wcf service: public class AddFavorites : Page { // Add [WebGet] attribute to use HTTP GET [WebGet(RequestFormat = WebMessageFormat.Json)] [OperationContract] public void AddFavorite() { this.AddMyFavorite(10, "sometext"...

Is this a correct way to host a WCF service?

For some testing code, I'd like to be able to host a WCF service in only a few lines. I figured I'd write a simple hosting class: public class WcfHost<Implementation, Contract> : IDisposable where Implementation : class where Contract : class { public readonly string Address = "net.tcp://localhost:8000/"; private Service...

Selectively apply authorization policy to operations

I have a WCF service with multiple operations exposed as a RESTful API. Most operations on the service do not require authentication/authorization, but one or two do. The authorization policy I need to use is outside of my control, and is expensive to run. Therefore, I'd like to avoid using it on those operations that do not require it. ...

WCF: Share Libraries with non-.NET webservice

Hi, I have exposed a Sonic ESB process as a webservice and wrote a .NET application to upload data to it by calling its methods. To this end, I have a library of complex object on the .NET side that I added in xml format to the web service definition on the Sonic ESB side. This is a necessary step in exposing the Sonic ESB process, be...

issue in WCF client app.config

Hello every one. In my service I am using ws2007FederationHttpBinding. When I am adding Service Reference in client side, in my app.config generated CustomBinding instead of ws2007FederationHttpBinding. Can any one tell me why? ...

Expose url to webservice

In our project we want to query a document management system for a specific document or movie. The dms returns a URL with the document location (for example: http://mydomain.myserver1.share/mypdf.pdf or http://mydomain.myserver2.share/mymovie.avi). We want to expose the document to internet users and intranet users. The requested file c...

WCF ReaderQuotas

I'm implementing a nettcp streaming channel in order to pull down large files from my server to a WPF client app. I made a change to the client config reader quotas in order to facilitate the size of the files but am experiencing an issue when changing the MaxBytesPerRead setting on the client. From what I understand this controls the am...

WCF host in windows service: cannot get wsdl

Hi guys! i've a windows service that hosts a WCF service with basicHTTPBinding. In test everything goes right, when i deploy the win service on a Window Server 2003, service hosts correctly wcf, I print out endpoints in tracing, they're correct, but when i ask for wsdl using the address that service exposed (i.e. http://mybaseaddress/?w...

WCF security when it is used with sync services

I am using following architecture for sync process. http://www.codeproject.com/KB/smart/sync_services.aspx And for server i use WCF service, can anybody guide me how can i secure my wcf service without using certificate that is hosted on IIS. Can i get a way to pass credential or some token to authenticate? I need to authenticate and...

Best Practice on storing WCF Binding paremeters to be shared by both proxies and WCF Services?

I am currently coding a set of helper classes to be used when creating a proxy client[for Client/Silverlight use] for consuming WCF services on the Server (NOT using Add Service Reference). Notice how I am setting up the buffer size to the max allowed (on the first code snippet), because for some services we have some big payload requ...

Is there a way to create a WCF DataContract on a third party type?

I am migrating to wcf and trying to figure out how I'm going to declare my Data Contracts properly. Some of the types I have been remoting are from a third party that I am unable to change. Are attributes the only way to explicitly declare data contracts in wcf? I know about the auto data contract functionality in 3.5, but the books I'...

Testing Ajax-Enabled WCF Service

Are there any tools in VS 2010 to test Ajax-Enabled WCF Service? I know the WCFTestClient can be used to test a regular WCF service but how can I test Ajax-Enabled WCF Service? ...

IsEmpty error when calling parameterless WCF method from Flex

I have a WCF web service (using basicHTTPBinding) which I am connecting to from a Flex application. I am using the FlexBuilder code generation to make a proxy for the web service. This has been working great until I tried to call a method on the web service that has no parameters. Here is it's interface declaration: [OperationCont...

WCF set bindings on service at runtime

My app has to be installed on my client's webservers. Some clients want to use SSL and some do not. My app has a WCF service and I currently have to go into the web.config for each install and switch the security mode from <security mode="Transport"> to <security mode="TransportCredentialOnly"> depending on the client's SSL situation. ...

Hide public Property when exposed through web service.

I would like to prevent a property from being exposed via my WCF web service. I tried adding the XmlIgnore attribute bug that didn't work. We are using .NET 3.5. WCF. This doesn't work: public class MyClass { public string S1 { get; set; } [XmlIgnore] public string S2NotExposed { get; set; } } ...

Web Services vs Persistent Sockets

I plan on doing a little benchmarking around this question, myself. But I thought it would be good to get some initial feedback from "the community". Has anyone out there done any analysis regarding the pros and cons of these two technologies? My thoughts: Opening and closing TCP/IP connections for web service calls is relatively ex...

Caller identity (Network Service account) obtained by WCF service is out of date

We have a WCF service using TCP binding, hosted in a Windows service. The WCF service is called by an ASP.NET web application. When the WCF service is called, I would like to check whether the calling identity is a member of a particular local group. A few ways to do this are: [PrincipalPermission(SecurityAction.Demand, Authenticated =...

Claims-based authentication for WCF RESTful services

Hi gang, I've been working through various samples to try and piece together a solution for SAML token-based authentication for ASP.Net web services and WCF RESTful web services... some of the samples I've been referencing: http://custombasicauth.codeplex.com/Wikipage http://www.leastprivilege.com/SecuringWCFDataServicesUsingWIF.aspx...