wcf-client

Using Wcf with gzip compression

不羁岁月 提交于 2020-01-04 05:15:08
问题 We have a wcf service that takes large amount of data. As a requirement we want to take the request objects gzipped and response them using the same compression. How can I do this? I couldn't find any document describing this issue. How can I develop a wcf soap service that works like that and how to consume this kind of services? 回答1: Microsoft has a sample that demonstrates this (you can compile their code, and simply plug it into your application) GZip Encoder Sample There is a more

WCF Service Generated Proxy Class Exposing Function as ByRef Sub

浪子不回头ぞ 提交于 2020-01-03 18:53:37
问题 I have a WCF Service exposing a single contract and operation: <ServiceContract(Namespace:="ImageSystem")> _ Public Interface IUploadService <OperationContract()> _ Function UploadFile(ByVal file As ImageUpload) As ImageUpload End Interface The function both receives and returns an "ImageUpload" which is defined as such: <MessageContract()> _ Public Class ImageUpload <MessageHeader()> _ Public Property ImageID() As Nullable(Of Long) <MessageHeader()> _ Public Property ImageTypeID() As Long

WCF Service Generated Proxy Class Exposing Function as ByRef Sub

元气小坏坏 提交于 2020-01-03 18:51:42
问题 I have a WCF Service exposing a single contract and operation: <ServiceContract(Namespace:="ImageSystem")> _ Public Interface IUploadService <OperationContract()> _ Function UploadFile(ByVal file As ImageUpload) As ImageUpload End Interface The function both receives and returns an "ImageUpload" which is defined as such: <MessageContract()> _ Public Class ImageUpload <MessageHeader()> _ Public Property ImageID() As Nullable(Of Long) <MessageHeader()> _ Public Property ImageTypeID() As Long

.NET Web Service (asmx) Timeout Problem

◇◆丶佛笑我妖孽 提交于 2020-01-02 04:45:07
问题 I'm connecting to a vendor-supplied web ASMX service and sending a set of data over the wire. My first attempt hit the 1 minute timeout that Visual Studio throws in by default in the app.config file when you add a service reference to a project. I increased it to 10 minutes, another timeout. 1 hour, another timeout: Error: System.TimeoutException: The request channel timed out while waiting for a reply after 00:59:59.6874880. Increase the timeout value passed to the call to Request or

A socket operation was attempted to an unreachable host

陌路散爱 提交于 2020-01-01 09:55:24
问题 One customer reported this error at my WCF client connecting to our server service. "Message: A socket operation was attempted to an unreachable host Type : System.Net.Sockets.SocketException" From this link http://msdn.microsoft.com/en-us/library/ms740668%28v=vs.85%29.aspx i see: WSAEHOSTUNREACH 10065 No route to host. A socket operation was attempted to an unreachable host. See WSAENETUNREACH. WSAENETUNREACH 10051 Network is unreachable. A socket operation was attempted to an unreachable

WCF Error: The message with Action cannot be processed at the receiver

自古美人都是妖i 提交于 2020-01-01 07:24:30
问题 I get famous error in web application, which is WCF client: The message with Action cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None). Several

Two WCF services with different contracts but same business objects

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 05:25:07
问题 For example I have two services hosted in IIS. [ServiceContract] public interface IDeviceService { [OperationContract] DeviceCollection GetAllDevices(Customer customer); } [ServiceContract] public interface IUserService { [OperationContract] User Authenticate(string username, string password); } Both the User object that is returned from the Authenticate operation in the UserService and the DeviceCollection that is returned from the GetAllDevices operation in the DeviceService have a child

Where to trap failed connection on WCF calling class?

孤人 提交于 2019-12-30 09:35:02
问题 I'm trying to write a class that encapsulates WCF calls (the client is Silverlight, if it matters). It all works swimmingly, but I'm not sure how to trap a connection failure, as if the server won't respond. It would appear that bit of work happens somewhere in the resulting code from ChannelFactory, but I'm not sure. General code review is welcome also. :) Bottom line, surrounding the creation of the channel, or the begin or async result delegate in try/catch doesn't trap a failed connection

How to consume multiple WCF services from one client

ⅰ亾dé卋堺 提交于 2019-12-30 04:58:09
问题 I am still learning the whole WCF thing, so please bear with me here. What I have is two self hosted services created using C# and VS 2008: Service # 1 Adds two numbers and returns the result. Service # 2 Returns the square of a number. I want the client to be able to send in two numbers to Service 1, get the sum and then send the sum in to Service 2 and get the square. I have two generated proxies for both the services, and I am able to use Intellisense on them, so that part supposedly works

WCF Proxy Returning Array instead of List EVEN THOUGH Collection Type == Generic.List

China☆狼群 提交于 2019-12-30 04:03:25
问题 I have a VS 2010 solution containing a WCF Library project and another project consuming that web service. After opening in VS 2012, it was upgraded. The proxy now returns List<T> types as arrays, even though CollectionMappings is clearly set to Generic.List. What could be happening? Someone else has a similar problem here but he was downgrading from VS 2012 to VS 2010 instead. Edit: I double checked, and Reference.svcmap contains: <CollectionMappings> <CollectionMapping TypeName="System