wcf-client

How to re-write WCF client to use ChannelFactory instead of service reference

我的未来我决定 提交于 2019-12-13 05:40:35
问题 I have a WCF service created using the web service software factory. All my incoming requests and returned responses are implemented as message contracts. I had been accessing the service by adding a service reference in VS which worked fine. However I've now been told that this isn't the standard company way and that I need to call the service using an in-house WCF proxy helper class based on the System.ServiceModel.ChannelFactory. I've never used the ChannelFactory before and I'm struggling

WCF Authentication NT Challenge response

假装没事ソ 提交于 2019-12-13 05:40:02
问题 How can I get my console app to connect with an IIS hosted WCF service when basic and/or windows authentication is switched on and anonymous authentication turned off? The site is internal and stringent security is not required. There is no domain controller. However, I need to turn off anonymous access. I have searched for days and have tried many methods including using a self hosted certificate and overriding the certification validation, overriding the UserNameValidator and using client

Call an operation that was dynamically added to the service contract

我与影子孤独终老i 提交于 2019-12-13 04:20:14
问题 I have a WCF service contract (say IService1) to which I dynamically add an operation like described here. How could I call a dynamically added operation from the client-side when all I have is an IService1 transparent proxy and the IClientChannel created via the ClientChannelFactory? Update I can get the RealProxy from the transparent proxy returned from the ChannelFactory using this method. var realProxy = System.Runtime.Remoting.RemotingServices.GetRealProxy( transparentProxy ); Would it

Selfhosted WCF service cant be tested via WCFTestClient

◇◆丶佛笑我妖孽 提交于 2019-12-12 13:09:11
问题 I am trying to test my self hosted wcf service using WCFTestClient. I get an error like so: Error: Cannot obtain Metadata from http://localhost:2303/MyService If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: http:/

HttpClient posting byte[] to WCF service produces error: The maximum array length quota (16384) or the maximum items

蓝咒 提交于 2019-12-12 12:26:51
问题 I have a WCF service that can accept a byte[] . I'm creating a client using HttpClient and am receiving the following error. I've read online that you have to set the readerQuotas on both the server and the client, but how do I set these settings on the HttpClient ? Error: There was an error deserializing the object of type RTM.API.Resources.UGCRequest. The maximum array length quota (16384) or the maximum items in object graph quota has been exceeded while reading XML data. These quotas may

What files in Service References must be deployed to consume a WCF service?

送分小仙女□ 提交于 2019-12-12 12:14:51
问题 I'm concerned about files should be included in a deployment of a .NET project. I have console applications that are consuming a WCF service. The WCF service is running over HTTP. Do I need to deploy all the XSD, SVCINFO, WSDL & SVCMAP files that are in the Service References folder? Thanks for any help. I sure wish there was a single page at Microsoft that definitively explained what file types were required in a deployment. 回答1: The only bits you need at installation time are the compiled

WCF net.tcp server disconnects - how to handle properly on client side?

橙三吉。 提交于 2019-12-12 05:39:10
问题 I'm stuck with a bit of an annoying problem right now. I've got a Silverlight 4 application (which runs OOB by default). It uses WCF with net.tcp as means of communicating with the server. The client uses a central instance of the wcf client proxy. As long as everything keeps running on the server side, everything's fine. If i kill the server in the middle of everything, i drown in an avalanche of exceptions on the client side (connection lost, channel faulted etc etc). Now i'm looking for a

How to handle WCF connection when calling method in loop

半城伤御伤魂 提交于 2019-12-12 04:46:00
问题 I am calling WCF method in for loop. I have couple of questions in this regard, 1) In this case if error occurs while its in the loop, where to re-open the connection? 2) Where to close the connection? MyProxy.DemoServiceClient wsDemo = new MyProxy.DemoServiceClient(); foreach (DataRow dataRow in dataTABLE.Rows) { Product product = new Product(); //Populate product using DataRow. try { wsDemo.CreateProduct(product); } catch (Exception exc) { } } 回答1: Abort and re-open the connection in the

Accessing HTTP status code while using WCF client for accessing RESTful services

六眼飞鱼酱① 提交于 2019-12-12 01:15:49
问题 Thanks to this answer, I am now able to successfully call a JSON RESTful service using a WCF client. But that service uses HTTP status codes to notify the result. I am not sure how I can access those status codes since I just receive an exception on client side while calling the service. Even the exception doesn't have HTTP status code property. It is just buried in the exception message itself. So the question is, how to check/access the HTTP status code of response when the service is

Using a Callback to pass an Event to a WCF Client

假如想象 提交于 2019-12-11 22:50:04
问题 I am trying to have my WCF client receive info from a callback. I have created a Client Library that any WCF Client can use to connect to my WCF Service. I am uncertain if I should implement the Callback in the Client Library or the WCF Client itself. I have attempted to create an event that will be fired by calling the OnNotification(...) method from within the callback. However, it cannot be called from within the Callback method and I'm not sure why. Here is my Client Library used to