wcf

WCF: collection proxy type on client

I have the following type in wsdl (it is generated by third party tool): <xsd:complexType name="IntArray"> <xsd:sequence> <xsd:element maxOccurs="unbounded" minOccurs="0" name="Elements" type="xsd:int" /> </xsd:sequence> </xsd:complexType> Sometimes Visual Studio generates: public class IntArray : System.Collections.Generic....

What is the use of "AsyncPattern" property of "OperationContractAttribute" + wcf?

Thus for used ajax enabled wcf services to get records from DB and display it in client without using AsyncPattern property of OperationContractAttribute.... When should i consider AsyncPattern property? Sample of my operationcontract methods, [OperationContract] public string GetDesignationData() { DataSet dt = GetDes...

Alternative for dataset/datatable returned from ajax enabled wcf service?

I have seen blogs and people saying Returning dataset/datatable from an ajax enabled wcf service is a bad idea.... I have gone through this Scott Hanselman's blog about datasets fr0m wcf... So what is the alternative for dataset returned form ajax enabled wcf service? ...

SecurityNegotiationException on disconnected domain client

When I am running a WCF service on my development machine it works as long as the client is connected to the domain. When the machine is disconnected I get the following exception: System.ServiceModel.Security.SecurityNegotiationException: A call to SSPI failed, see inner exception. System.Security.Authentication.AuthenticationExc...

WCF/S#arpArch: underlying ISession is closed after the first call within a request

I know the use of WCF in SA is deprecated because it will move to SA Contrib. But until it has, I guess I have to use the support in SA. That said, I have a problem with the underlying NHibernate session being closed after calling a WCF service. My repository's DbContext.Session is closed after the first call so I cannot call my service...

Do WCF / IIS timeouts need a rewrite?

This is one of those subjective community wiki questions (hope you don't mind), but recently I have been doing a lot of work on the WCF front and specifically hosting in IIS (not self hosting). Is it just me, or does anyone have issues fine tuning timeout values. I'll start by mentioning the sheer number of timeouts you need to fine tu...

Returning a Dataview in a WCF Service

I have a method in my web service which returns a DataView, I have setup a proxy which talks to this service but when i make this method in the proxy public DataView GetSales(DateTime SalesDate) { ServiceClient client = new ServiceClient(); return client.GetSalesForDay(SalesDate); } I get the error "Cannot impl...

WCF Exception Handling Strategies

We are developing a proxy in WCF that will serve as a means of communication for some handhelds running our custom client application. I am curious what error handling strategies people use as I would rather not wrap EVERY proxy call in try/catch. When I develop ASP .NET I dont catch the majority of exceptions, I leverage Application_E...

WCF (Silverlight) Duplex - Not hitting server

Hi Folks, I have created a web application with a Silverlight project embedded in it, using VS 2008 SP 1, and the Silverlight 3 tools, on Vista and Windows 7. The duplex service code: [ServiceContract(Namespace = "cotoco", CallbackContract = typeof(IDuplexClient))] [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)...

Trouble writing programmatic config changes for WCF

I need to be able to update my config file programmatically and change my WCF settings. I've been trying to do this inside of some test code using some of the examples I found on the web but so have not been able to get the config file to reflect a change to an endpoint address. Config (snippet): <!-- Sync Support --> <serv...

How to run WCF service and Silverlight 3 client app in one VS debug session

Is this possible? I have a solution with both projects, I just want to be able to hit F5 and debug both client and server at the same time. Thanks! ...

Trying to call a WCF service with a WebRequest

I have a WCF service that needs to be called by a 3rd party app, posting some raw XML. I am trying to test my service by constructing a simple WebRequest and making the request to the service. Here's my service code: Interface: [ServiceContract(Namespace = "http://test.mydomain.com")] public interface ITest { [WebInvoke(UriTe...

.NET: How to binary serialize an object with attribute [DataContract]?

Class marked as [DataContract] can't be ISerializable at the same time. OK, so how can I serialize this type of object to a binary stream? private byte[] GetRoomAsBinary(Room room) { MemoryStream stream = new MemoryStream(); BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(stream, room...

Trouble with an enumeration as a key in a Dictionary collection

I have a scenario where I'm using a Dictionary to hold a list of transaction types that a certain system accepts. The key in the Dictionary is an enum field, the value is an int. At some point in the system, we're going to want to do something like this: sqlCommand.Parameters.AddWithValue("@param", LookupDictionary[argument.enumField])...

System.ServiceModel.CommunicationException - On Large Message Size

I'm getting this exception on the client application, not sure how to get past this. I encounter this exception when the data returned(A list of prices) exceeds 15MB, but works for message size less that 15MB. Error Message: An error occurred while receiving the HTTP response to "http://localhost:8782/CMDService". This could be due to ...

In WCF Ria Services, is it possible to other to connect to my Service? If yes, how can I ban it.

Is it possible for others to connect to my defined services in my Ria application. If yes, how can we remove this access? Thanks in advanced! ...

WCF Thread was being aborted error

I have a WCF service that works fine in IIS 7, however once deployed to Windows Server 2003, IIS6, I'm now getting - "The thread was being aborted" error message. This happens after a few minutes of the service running. I've tried manually changing some timeout values and turned off IIS keep alives. Any ideas on how to fix this proble...

I want to be able to use a lambda expression to specify a range of values to return over a wcf service

I have no idea if this is possible ... but it would be cool. the question is whether it is possible but then a bit of an example if possible. I am not sure what method signature you would use to pass the lambda expression into. Eg the method IList<Group> GetGroups() How would you modify that to be able to pass a lambda expression into...

How do you change the SOAP Envelope schema in WCF?

I am connecting to a third-party end point via WCF and I have one problem. The schema for the SOAP envelope that is generated by WCF isn't compatible with the end point. Currently WCF is generating this: <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"&gt; But it needs to b...

What is the use of spring.net?

We are developing an application using Silverlight and WCF Services. Is using Spring.Net is beneficial for us? ...