wcf-binding

Timeouts WCF Services

ε祈祈猫儿з 提交于 2019-11-26 18:31:11
How do the timeouts work in WCF? I know for example that you can configure sendTimeout and receiveTimeout for a clients binding. But how do they work? MSDN describes sendTimeout as: A TimeSpan value that specifies the interval of time provided for a send operation to complete. This value should be greater than or equal to Zero. The default is 00:01:00. What are send operations/receive operations? Brian Client side: SendTimeout is used to initialize the OperationTimeout, which governs the whole interaction for sending a message (including receiving a reply message in a request-reply case). This

Maximum array length quota

自古美人都是妖i 提交于 2019-11-26 17:42:00
I'm writing a small WCF/WPF app to resize images but WCF is giving me grief when I try to send an image of size 28K to my service from the client. The service works fine when I send it smaller images. I immediately assumed that this was a configuration issue and I've trawled the web looking at posts regarding the MaxArrayLength property in my binding configuration. Ive upped the limits on these settings on both the client and server to the maximum 2147483647 but still I get the following error: The formatter threw an exception while trying to deserialize the message: There was an error while

XDocument.Descendants() not returning any elements

痞子三分冷 提交于 2019-11-26 16:59:21
问题 I'm trying to bind a Silverlight DataGrid to the results of a WCF service call. I was not seeing the data displayed in the grid, so when I ran through the debugger, I notice that XDocument.Descendants() was not returning any elements even when I was passing in a valid element name. Here is the XML that is passed back from the service: <ArrayOfEmployee xmlns="http://schemas.datacontract.org/2004/07/Employees.Entities" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <Employee> <BirthDate

BasicHttpBinding vs WsHttpBinding vs WebHttpBinding

大憨熊 提交于 2019-11-26 16:51:41
In WCF there are several different types of HTTP based bindings: BasicHttpBinding WsHttpBinding WebHttpBinding What are the differences among these 3? In particular what are the differences in terms of features / performance and compatability? You're comparing apples to oranges here: webHttpBinding is the REST-style binding, where you basically just hit a URL and get back a truckload of XML or JSON from the web service basicHttpBinding and wsHttpBinding are two SOAP-based bindings which is quite different from REST. SOAP has the advantage of having WSDL and XSD to describe the service, its

How can I use WCF with only basichttpbinding, SSL and Basic Authentication in IIS?

我只是一个虾纸丫 提交于 2019-11-26 15:27:49
问题 Is it possible to setup a WCF service with SSL and Basic Authentication in IIS using only BasicHttpBinding-binding? (I can’t use the wsHttpBinding-binding) The site is hosted on IIS 7, with the following authentication set up: - Anonymous access: off - Basic authentication: on - Integrated Windows authentication: off !! Service Config: <services> <service name="NameSpace.SomeService"> <host> <baseAddresses> <add baseAddress="https://hostname/SomeService/" /> </baseAddresses> </host> <!--

WCF service The maximum array length quota (16384) has been exceeded

依然范特西╮ 提交于 2019-11-26 13:44:24
问题 I have a wsf service and a client application. While trying to communicate the client and the service I've gotten the following message: " The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:blob. The InnerException message was 'There was an error deserializing the object of type FileBlob. The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be

How to programmatically connect a client to a WCF service?

时光怂恿深爱的人放手 提交于 2019-11-26 12:47:46
I'm trying to connect an application (the client) to an exposed WCF service, but not through the application configuration file, but in code. How should I go about doing this? Enrico Campidoglio You'll have to use the ChannelFactory class. Here's an example: var myBinding = new BasicHttpBinding(); var myEndpoint = new EndpointAddress("http://localhost/myservice"); using (var myChannelFactory = new ChannelFactory<IMyService>(myBinding, myEndpoint)) { IMyService client = null; try { client = myChannelFactory.CreateChannel(); client.MyServiceOperation(); ((ICommunicationObject)client).Close();

The content type application/xml;charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8)

随声附和 提交于 2019-11-26 11:21:48
问题 I trying to consume a WCF web service using stand alone application. I am able to view this service using Internet Explorer also able to view in Visual studio service references. This is the error I am getting The content type text/html; charset=UTF-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). How do I change this to use the correct content type? Here is my config file <?xml version=\"1.0\" encoding=\"utf-8\" ?> <configuration> <startup>

How to consume WCF web service through URL at run time?

ぐ巨炮叔叔 提交于 2019-11-26 11:21:42
问题 I want to access all the methods exposed in the service through the URL. if suppose the URL will be : http://localhost/MyService/MyService.svc How can I access methods: if suppose I have a ServiceReference and what should I do if don\'t have the Service Reference. 回答1: In order to use a WCF service, you will need to create a WCF client proxy. In Visual Studio, you would right-click on the project and pick the "Add Service Reference" from the context menu. Type in the URL you want to connect

WCF change endpoint address at runtime

怎甘沉沦 提交于 2019-11-26 08:04:49
问题 I have my first WCF example working. I have the host on a website which have many bindings. Because of this, I have added this to my web.config. <serviceHostingEnvironment multipleSiteBindingsEnabled=\"true\"/> This is my default binding http://id.web, which works with the following code. EchoServiceClient client = new EchoServiceClient(); litResponse.Text = client.SendEcho(\"Hello World\"); client.Close(); I am now trying to set the endpoint address at runtime. Even though it is the same