wcf

Is there an issue sending XML via WCF?

Suppose you have an XElement or an XmlElment or even a string containing xml that you want to send via WCF. Are there any special precautions you have to take? The question just came up, what happens when, within the xml message, you transmit an xml document declaration (<?xml version=’1.0’ ?>), which may happen if serializing an XmlDo...

Add WCF Service reference fails. And VS2008 exits

I have a super-simple WCF Service. I host it on my local machine using IIS7. When I add a service reference to my service, Visual Studio tells me there was an error. I can click a Details link, and that bring up a dialog box saying: Object reference not set to an instance of an object. I can build my WCF service with no problems, and ...

WCF Service authorization patterns

Hi all, I'm implementing a secure WCF service. Authentication is done using username / password or Windows credentials. The service is hosted in a Windows Service process. Now, I'm trying to find out the best way to implement authorization for each service operation. For example, consider the following method: public EntityInfo GetEnt...

Accepting form fields via HTTP Post in WCF

I need to accept form data to a WCF-based service. Here's the interface: [OperationContract] [WebInvoke(UriTemplate = "lead/inff", BodyStyle = WebMessageBodyStyle.WrappedRequest)] int Inff(Stream input); Here's the implementation (sample - no error handling and other safeguards): public int Inff(Stream input) { StreamReader ...

How to get WCF statistics from inside an application that uses it?

Is it possible to gather performance statistics programmatically from inside a WCF application? For example, the number of connections open or requests received. ...

What authentication to pick for the cross-platform WCF service?

What type of authentication would you suggest for the service that is: implemented as WCF and exposed via varios enpoints (including XML-RPC) has to be consumed easily by various cross-platform clients Why? Options that I'm aware of are: Forms-based authentication for IIS-hosted WCF (easy to implement, but has horrible cross-platf...

How can I distribute a WCF Peer to Peer application over the Internet?

Can someone point me in the right direction? I wish to distribute a WCF peer to peer cloud over the internet. So far I've seen examples of how it works on the same subnet. I wish to push it a little further. ...

WCF Unit Test

How to unit test WCF services? Any 3rd Party tools available? ...

How do I make a JavaScript call to a WCF service hosted on a different domain?

We are designing a web application using ASP.NET and AJAX and we want to host our WCF Service Layer on a different website and make JavaScript calls to the Service Layer from our client pages. We understand that the browser will not allow AJAX calls to a different port or domain. What is the best way to architect a solution? We are co...

Wcf and Interfaces as Parameters

hi there, i have a library with some entities that share the same interface. clients and service share this assembly. now i wonder if there is a way to have this Interface-type as Parameter in my service contracts so that i can use the same method for all classes implementing the interface. the entities themselve are all decorated with...

WCF is not binding to the correct IP address

We have a WCF service deployed on a Windows 2003 server that is exhibiting some problems. The configuration is using wsHttpBinding and we are specifying the IP address. The services is being hosted by a Windows Service. When we start the service up, most of the time it grabs the wrong IP address. A few times it bound to the correct a...

How to consume a wcf service when i only know its URL

I need to consume a wcf service dynamically when all i know is its URL. I do not have the option of creating a service reference or web reference as my client side code picks up the URL from a config file. What classes and methods can i use from the System.ServiceModel namespace for doing so. ...

Controlling the WCF XmlSerializer

I have some REST web services implemented in WCF. I wish to make these services return "Bad Request" when the xml contains invalid elements. The xml serialization is being handled by XmlSerializer. By default XmlSerializer ignores unknown elements. I know it is possible to hook XmlSerializer.UnknownElement and throw an exception from th...

Using Linq with WCF

I am looking for any examples or guides to using Linq over WCF (n-tier application). Please specify if you are showing something for Linq-to-SQL or Linq-to-entities. I would like to see usage examples for both. I am wondering how things like deffered execution works over WCF (if it works at all)? Cyclic references support and so on... ...

[XmlRoot] attribute not included in the generated proxy class

Using .Net 3.0 and VS2005. The objects in question are consumed from a WCF service then serialized back into XML for a legacy API. So rather than serializing the TestObject, it was serializing .TestObject which was missing the [XmlRoot] attribute; however, all the [Xml*] attributes for the child elements were in the generated proxy cod...

Finding the time taken to send messages with WCF net.tcp

I’m writing a prototype WCF enabled distributed app, to try and find out any issues I’ll have upgrading my existing “sending xml over tcp to communicate” apps I’ve got. I’m using Callback Contracts to register clients with a server (Singleton in ServiceHost) and so far all the communications between client and server work. I can connec...

Experience with CSLA in a WPF/WCF application

Has anyone used CSLA in an application that has a WPF front end and a WCF wire for entities? If so, which "entity framework" did you use? (nHibernate, Linq, etc...) What were the hang-ups? What did it help you with? I am concerned with implementing this for an application, not knowing how data-binding, validation with UI/entities, or ...

How do you specify a message label when using WCF and NetMsmqBinding?

I would like to set the MSMQ message label using the NetMsmqBinding. I understand it’s easy when using the MsmqIntegrationBinding, but I would like to continue to use the NetMsmqBinding (even call private methods, if possible) ...

What is Microsoft's official stance on using WCF with Visual Studio 2005?

I noticed last night that the WCF extensions for Visual Studio 2005 aren't available on their site any longer. I've read that they want people to use Visual Studio 2008 for WCF/WF/WPF. Have they made an official statement regarding this? edit: I already have the CTP3 for VS2005. I want to know what Microsoft's official stance is. Y...

WSDL URL for a WCF Service (basicHttpBinding) hosted inside a Windows Service

I am hosting a WCF service in a Windows Service on one of our servers. After making it work in basicHttpBinding and building a test client in .NET (which finally worked) I went along and try to access it from PHP using the SoapClient class. The final consumer will be a PHP site so I need to make it consumable in PHP. I got stumped when ...