For questions about Windows Communication Foundation (WCF) clients.
Questions tagged [wcf-client]
757 questions
423
votes
26 answers
What is the best workaround for the WCF client `using` block issue?
I like instantiating my WCF service clients within a using block as it's pretty much the standard way to use resources that implement IDisposable:
using (var client = new SomeWCFServiceClient())
{
//Do something with the client
}
But, as…

Eric King
- 11,594
- 5
- 43
- 53
75
votes
2 answers
How to programmatically connect a client to a WCF service?
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?

Alex
- 7,432
- 20
- 75
- 118
50
votes
1 answer
Is it possible to call Dynamics CRM 2011 late-bound WCF Organization service without the SDK - straight customized binding?
I'm trying to implement a pure WCF scenario where I want to call Dynamics CRM WCF service without relying on the SDK helper classes. Basically, I would like to implement federated authentication against Dynamics CRM 2011 using only native WCF…

Maxime Labelle
- 3,609
- 2
- 27
- 48
50
votes
5 answers
How to make sure you don't get WCF Faulted state exception?
I am getting this exception:
The communication object,
System.ServiceModel.Channels.ServiceChannel,
cannot be used for communication
because it is in the Faulted state.
The WCF service uses the default wsHttpBinding. I am using WCF in the…

Perpetualcoder
- 13,501
- 9
- 64
- 99
43
votes
5 answers
WCF change endpoint address at runtime
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.
This is my default binding…

Valamas
- 24,169
- 25
- 107
- 177
43
votes
7 answers
Error consuming webservice, content type "application/xop+xml" does not match expected type "text/xml"
I'm having a weird issue when consuming a webservice for a product that my company has bought. The product is called Campaign Commander and it's made by a company called Email Vision. We're trying to use the "Data Mass Update SOAP API".
Whenever I…

Doctor Jones
- 21,196
- 13
- 77
- 99
38
votes
3 answers
Async WCF client calls with custom headers: This OperationContextScope is being disposed out of order
I'm calling a WCF service from a WinRT app. The service requires that some headers are set for the authentication. The problem is that if I do multiple calls to the service simultaneously, I get the following exception:
This OperationContextScope…

Mikael Koskinen
- 12,306
- 5
- 48
- 63
32
votes
2 answers
How to add custom soap headers in wcf?
Can I add Custom SOAP header in WCF incoming/outgoing messages in basicHttpBinding, like we can add custom authentication header in ASMX web services? Those custom SOAP header should be accessible using .net 2.0/1.1 web service clients (accessible…

nRk
- 1,251
- 7
- 24
- 50
24
votes
1 answer
WCF - channel factory vs client base
I am new to WCF. Initially I created a WCF service and used the generated client proxy to consume the service from client. So whenever I performed some operations on service everything executed sequentially as I am invoking operations synchronously.…

Dreamer
- 3,371
- 2
- 34
- 50
22
votes
3 answers
WCF client endpoint: SecurityNegotiationException without
I'm having a strange situation here. I got it working, but I don't understand why.
Situation is as follows:
There is a WCF service which my application (a website) has to call. The WCF service exposes a netTcpBinding and requires Transport…

RoelF
- 7,483
- 5
- 44
- 67
15
votes
5 answers
How to consume WCF web service through URL at run time?
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…

Ashish Ashu
- 14,169
- 37
- 86
- 117
13
votes
4 answers
SSPI: user principle name WCF client
I am trying to access a wcf client. I know people are getting information out of it right now, so I know it works. My problem is I can't seem to get past it. The service is a mutual certific service. I have the appropriate certs in my personal…

SoftwareSavant
- 9,467
- 27
- 121
- 195
12
votes
5 answers
Service Unavailable 503 + The HTTP service located at http://localhost/ProductsService/Service.svc is too busy
Hi I have been trying to solve my problem, however couldn't do anything about it.
The problem is
http://localhost/productservice/service.svc when type this address in my browser it gives me 503 Service Unavailable error
When I run my code from VS…

Pinchy
- 1,506
- 8
- 28
- 49
12
votes
1 answer
Setting Message version in code for WCF client
I want to set message version for WSHttpBinding to EnvelopeVersion.Soap11. I don't know how to do that. Can any one help me. Here is my binding code
var binding = new WSHttpBinding()
{
UseDefaultWebProxy = true,
…

Amzath
- 3,159
- 10
- 31
- 43
12
votes
3 answers
WCF Proxy Returning Array instead of List EVEN THOUGH Collection Type == Generic.List
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 types as arrays, even though CollectionMappings is clearly set to…

Old Geezer
- 14,854
- 31
- 111
- 198