wcf-client

WCF client endpoint: SecurityNegotiationException without <dns>

时光毁灭记忆、已成空白 提交于 2019-12-03 08:31:53
问题 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 Security (Windows). Client and server are in the same domain, but on different servers. So generating a client results in the following config (mostly defaults) <system.serviceModel> <bindings> <netTcpBinding> <binding name="MyTcpEndpoint" ...>

WCF Proxy Client taking time to create, any cache or singleton solution for it

半腔热情 提交于 2019-12-03 04:13:38
we have more than dozon of wcf services and being called using TCP binding. There are a lots of calls to same wcf service at various places in code. AdminServiceClient client = FactoryS.AdminServiceClient();// it takes significant time. and client.GetSomeThing(param1); client.Close(); i want to cache the client or produce it from singleton. so that i can save some time, Is it possible? Thx Yes, this is possible. You can make the proxy object visible to the entire application, or wrap it in a singleton class for neatness (my preferred option). However, if you are going to reuse a proxy for a

WCF TCP clients - basic guidelines on how to use them?

蹲街弑〆低调 提交于 2019-12-03 03:51:29
I've got a WCF service and want to connect to it using a TCP binding. This is all well and good, but how are you supposed to handle the clients? I've noticed that if you create a new client for each call it doesn't re-use the channel and leaves around a bunch of TCP connections until they time out. Is it normal use to create a client, call a method on it, then close it? What if you want to re-use the connection? What are the limitations on that? Can you make simultaneous calls from different threads? If you can't, do you have to do your own connection pooling? And when re-using the connection,

WCF Client Configuration: how can I check if endpoint is in config file, and fallback to code if not?

半城伤御伤魂 提交于 2019-12-02 23:37:38
Looking to make a Client that sends serialized Message objects back to a server via WCF. To make things easy for the end-developer (different departments) would be best that they didn't need to know how to edit their config file to set up the client end point data. That said, would also be brilliant that the endpoint wasn't embedded/hard-coded into the Client either. A mix scenario would appear to me to be the easiest solution to roll out: IF (described in config) USE config file ELSE fallback to hard-coded endpoint. What I've found out is: new Client(); fails if no config file definition

Multiple name spaces in a soap fault message causing FaultException deserialization to fail

浪尽此生 提交于 2019-12-02 01:15:59
We're connecting to a web service and the fault message we're getting back isn't deserializing (at all), and no version of class that I can make will deserialize correctly. We have no control over the server side of things. The server does not allow for discovery, so adding ?WSDL to the end of the URL of the endpoint results in an error, not a WSDL. [Fiddler][1] shows the Fault message coming back looks like: <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:eGov="http://eGov.gov" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <soapenv:Fault> <faultcode

What happens when a WCF client specifies multiple endpoints for the same contract?

流过昼夜 提交于 2019-12-01 17:40:56
Will it consume from all of them? Will it throw an exception? You can have multiple endpoints for the same contract and different addresses in your clieint config, no problem. They need to be separated by a unique name= attribute on the <endpoint> tag. <client> <endpoint name="tcpEndpoint" address="net.tcp://server:8888/SomeService" binding="netTcpBinding" contract="IYourService" /> <endpoint name="httpEndpoint" address="http://server:8777/SomeService" binding="basicHttpBinding" contract="IYourService" /> </client> When you create your client proxy, you need to provide the name of the endpoint

Where to trap failed connection on WCF calling class?

旧巷老猫 提交于 2019-12-01 06:00:51
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. I'd like to have that catch run the ServiceCallError event. public class ServiceCaller : IDisposable

WCF System.Object Serialization

感情迁移 提交于 2019-12-01 01:34:40
I have a requirement in which i have to use System.Object as a parameter in WCF. As it is not serializable,I am getting the message as the operation is not supported as it uses System.Object. Any solution to this problem. When sending messages over the wire, WCF by default will only serialize what's enough to get the message across, i.e., the members of the contracts. If your message takes an "object" as a parameter, extra information needs to be sent over the wire with the type information. If you use the same assemblies on the client and the server, you can use the NetDataContractSerializer

How can I consume a WCF service using a local WSDL file?

≯℡__Kan透↙ 提交于 2019-11-30 18:51:59
I need to consume a WCF service based on a (preferably single) wsdl file. The environment is VS-2008 (sp1), and I will be using a customized "Add Service Reference" macro to generate an error handling proxy. I want to be able to do this, by supplying a WSDL file that I get from the service provider (I do not want to supply a host URL). How can this be done? marc_s Sure - you can copy the path+filename for the WSDL and paste that into the "Add Service Reference" dialog box in Visual Studio (or just type int the full path + WSDL file name). Alternatively, you can use the svcutil.exe command line

Loading the WCF configuration from different files on the client side

拟墨画扇 提交于 2019-11-30 15:45:43
问题 A common problem in WCF that many people face is the impossibility of loading the client configuration from different configuration files. This is a common scenario when the developer wants to deploy some binaries with along with an independent configuration file (Which may be in a resource file also or another configuration file) to avoid modifying the main configuration file. I have found two references: http://weblogs.asp.net/cibrax/archive/2007/10/19/loading-the-wcf-configuration-from