wcf

Are Enterprise Level DataContracts a Good Practice?

Is it a good practice to define DataContracts in an enterprise level assembly and then reference them in WCF service projects as opposed to defining them at the individual WCF service solution level? All of the WCF examples that I have seen have avoided that topic and have only defined DataContracts in the service solution. Some programm...

WCF WSDL location address with HTTPS

A common issue for WCF appears to be how the hostname is resolved within the wsdl for the links to other files. The issue is that the machine name of the computer is placed into the wsdl to link the other wsdl files, so if you visit http://myhost/service.svc it may point to the rest of the wsdl on another location, ie http://mypc/service...

How to use the single responsibility principle in large wcf services?

We're using about 7 services at the moment. There quite large. Does anyone have any experience with the single responsibility principle and WCF services? Does this mean that you'll end up with lot's of small contracts? If so, how do you manage these in your application? ...

Can WCF REST services support deserialisation of XML messages with arbitrary element order?

I have a C# WCF REST Service which allows the addition of a bookmark, by sending an HTTP POST request with the bookmark serialised in XML. I have specified the operation contract for the service, which picks up the xml and automatically deserialises the object for me. My problem is that the deserialisation only works correctly if the XML...

How can I use DIME with WSE 3.0?

I need to make calls to a legacy SOAP API that only supports DIME, but DIME is not supported in WSE 3.0. Unfortunately, WSE 2.0, which supports DIME, is not supported in conjunction with Visual Studio 2005. I understand the reasons for moving to MTOM, but the need to communicate with legacy services does not disappear because a new sta...

Is my WCF using the correct Binding?

Hi, My wcf service's web.config looks like this: How can I confirm that it is using the settings correctly? I still get this timeout error sometimes even though I have configured the binding to use: SendTimeout = 10 minutes etc. ? <system.serviceModel> <services> <service behaviorConfiguration="MyService.MyServiceBehavior"...

Authorization and Authentication using WCF

What are the best practices for handling security i.e. Authorization and Authentication in Web Application? I am working on a web application, using WCF as SOA, there are more chances that in future individual component in my application can be integrated with some third party application. I am looking for a solution by which I can hand...

What is the WCF equivalent of HttpContext.Current.Request.RawUrl?

I've got some RESTful services running in a pure WCF context (i.e. ASP.NET compatibility is not enabled, and thus there is no HttpContext.Current object available). The URLs to the services are rewritten at the start of the request using an IHttpModule (which at that point does have an HttpContext and rewrites it using HttpContext.Curre...

Getting a WCF service to map POST'd parameters to arguments

I have a legacy service I'm looking to update to WCF and one of it's behaviours is to allow clients to POST a request that has something like: MyService.asmx/ProcessDocument With Post data looking like: request=<big block of xml> Now in the ASMX days this service accepted a single string parameter i.e: public void ProcessDocument(st...

what user account does my IIS hosted wcf service run under?

Hi, what user account does my .net wcf service run under when I am hosting it in iis 7? Is it the IUSR_machine account? What is the easiest way for me to run under a different account? (just for this service, don't want other things hosted in my IIS to be effected). ...

.Net WFC/Web service exception handling design pattern

I'm trying to come up with a simple, easy to use design pattern for error handling in a .net wcf service (specifically a silverlight enabled wcf service). If an exception gets thrown in the service method the silverlight application will see a CommunicationException stating "The remote server returned an error: NotFound ---> " and possib...

Can I pass a System.Net.MailMessage to a WCF service?

I'd like to setup a WCF service to send emails. The System.Net.MailMessage doesn't seem to be serializable, and cannot be passed in a [DataContract] The error I receive is Type 'System.Net.Mail.MailAddress' cannot be serialized. Consider marking it with the DataContractAttribute Any suggestions? ...

Hosting WCF on IIS6, does it require any special setup?

Hi, Does hosting a WCF service require any special configuration on IIS6? ...

Anti-pattern of SOA or WCF

While I can find lots of article advocating SOA, or WCF, my question is that what should not be exposed as service, is there any lessen that we learn from SOA failure. WCF is a way to implementing SOA, if we use WCF, does that means we are implementing SOA. For sure there are lots people using C# writing unmaintainable code. Thanks Fred...

Is there a way to get error feedback on asynchronous WCF calls?

Hi, I have a WCF service which works 100% in the synchronous (blocking) mode and I now need to rework a call so that it uses the async pattern. The service uses authentication and performs a chunked file transfer from client to server so I have reworked it to use the 'Begin' async prefix to kick off the call. Now I'm testing for error...

Customer WCF Bindings / Binding Elements For Encryption

I am trying to implement encryption for my WCF service. I am aware that there are several options out there for me to do this. I am not interested in them. I would like to use a password to regenerate repeatable RSA keys. These keys will then be used to exchanged AES keys which will be used to encrypted the actual passed data. I think I...

Is there a way to write asp.net web service so they are easier to convert to WCF?

For example, I know that the WCF style web services don't rely so much on Session/Application/Request/Response as web services did. Are there any other gotchas I should keep in mind when writing web services today with the intention of making them WCF services as soon as my organization lets me use WCF? I don't think I'm interested writ...

WCF minimal app.config settings

What are the minimal settings i need to do for a streamlined WCF config in the app.config? The default one is this: <bindings> <wsHttpBinding> <binding name="WSHttpBinding_IService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" byp...

Serialize a FileStream for transport

See also this question: http://stackoverflow.com/questions/447071/can-i-pass-a-system-net-mailmessage-to-a-wcf-service I'd like to add attachments to the mail being sent. Attachments are either files on the local disc, or dynamically created Streams. A WCF contract can contain a Stream, but only when all arguments are of type Stream. So...

Conceptual overview of WCF security model?

I'm working with WCF at the moment and attempting to implement a custom security model based around an API key and signature (similar to how Facebook/Flickr/OAuth etc. work). There are a while bunch of classes like ServiceAuthorizationManager, SecurityToken, SecurityTokenValidator, IAuthorizationPolicy and so on, but I can't seem to fin...