wcf-endpoint

How to add maxItemsInObjectGraph programmatically without using configuration file?

安稳与你 提交于 2019-12-04 02:29:37
I have create a EndpointAddress like that EndpointAddress address = new EndpointAddress("http://example.com/services/OrderService.svc"); But I could not add the Behavior to this Endpoint programmatically. The behavior is given below.: <behaviors> <endpointBehaviors> <behavior name="NewBehavior"> <dataContractSerializer maxItemsInObjectGraph="6553600" /> </behavior> </endpointBehaviors> </behaviors> On the server you have to add it in the ServiceBehavior Attribute: [ServiceBehavior(MaxItemsInObjectGraph = int.MaxValue)] On the client you have to apply it to the endpoint. In this example you can

Determine which wcf endpoint is being used on the server

こ雲淡風輕ζ 提交于 2019-12-03 23:56:31
I have a wcf service thats exposing a service using two endpoints. One endpoint is used for web service calls while the other is using rest. Is there a way to determine from which endpoint the server functions are being called? Actually, contrary to what I thought - it's actually pretty easy to find out what endpoint the service was called on. In your service method, add these lines of code: OperationContext oc = OperationContext.Current; if(oc != null) { string wasCalledOn = oc.EndpointDispatcher.EndpointAddress.Uri.ToString(); } But as I said : I would use this very wisely and "defensively"

How to detect binding from wcf service end

一世执手 提交于 2019-12-01 11:52:33
suppose i have one wcf service with multiple endpoint having different type of binding like tcp, basichttp, wshttp etc. <endpoint address ="" binding="wsHttpBinding" contract="NorthwindServices.ServiceContracts.ICustomerService" bindingNamespace = "http://dotnetmentors.com/services/customer" /> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> <endpoint address ="" binding ="netNamedPipeBinding" contract ="NorthwindServices.ServiceContracts.ICustomerService" bindingNamespace = "http://dotnetmentors.com/services/customer" /> <endpoint address="mex" binding=

How to detect binding from wcf service end

吃可爱长大的小学妹 提交于 2019-12-01 10:36:46
问题 suppose i have one wcf service with multiple endpoint having different type of binding like tcp, basichttp, wshttp etc. <endpoint address ="" binding="wsHttpBinding" contract="NorthwindServices.ServiceContracts.ICustomerService" bindingNamespace = "http://dotnetmentors.com/services/customer" /> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> <endpoint address ="" binding ="netNamedPipeBinding" contract ="NorthwindServices.ServiceContracts.ICustomerService"

Single endpoint with multiple service contracts

╄→гoц情女王★ 提交于 2019-12-01 05:48:25
How can I write a WCF web service that has single endpoint but multiple service contract? Example: [ServiceContract] public interface IWirelessService { [OperationContract] void AddWireless(); } [ServiceContract] public interface IWiredService { [OperationContract] void AddWired(); } [ServiceContract] public interface IInternetService { [OperationContract] void AddInternet(); } Lets think like IInternetService is my main webs service and i want to implement IwiredService and IWirelessService in it, but i want to do implementation in their classes.Is this possible? How can i solve this problem?

Using Castle Windsor WcfFacility to create client endpoints

不问归期 提交于 2019-11-30 09:46:09
I have created three assemblies. A web site, a WCF service and a contracts assembly that holds the interfaces that the services implement. I would like to use Castle Windsor to create the services for me on the client (website) so that I do not have to have an endpoint in the web.config of the web site for each service that I wish to use. I would like to look at the contract assembly and get all the service interfaces in a namespace. Right now for every service I have something like the following when registering the components with the container. container.Register(Component.For

This could be due to the service endpoint binding not using the HTTP protocol

懵懂的女人 提交于 2019-11-29 19:30:30
I have a WCF Service running fine on my local machine. I put it on the servers, and I am receiving the following error: An error occurred while receiving the HTTP response to http://xx.xx.x.xx:8200/Services/WCFClient.svc . This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.] I have gone to the service in the url and it is working correctly. All I am doing for the function is returning a string to an image name,

This could be due to the service endpoint binding not using the HTTP protocol

99封情书 提交于 2019-11-28 15:03:32
问题 I have a WCF Service running fine on my local machine. I put it on the servers, and I am receiving the following error: An error occurred while receiving the HTTP response to http://xx.xx.x.xx:8200/Services/WCFClient.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.] I have gone to the service in the url

Programmatically adding an endpoint

百般思念 提交于 2019-11-28 14:02:48
I have a WCF service that I am connecting in client application. I am using following in configuration file. <system.serviceModel> <bindings> <basicHttpBinding> <binding name="MyNameSpace.TestService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32"

WCF is using the computer name instead of the IP address and cannot be resolved

吃可爱长大的小学妹 提交于 2019-11-27 21:36:44
I have a WCF service that works fine on the LAN but when trying to access it from outside the service reference fails. My WCF service is hosted on a win2k3 box that is using a static IP no domain. Jorge Barrera This is what worked for me. In config file < serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> < / system.serviceModel > If it is set to false, I was getting that crazy computername substitution. multipleSiteBindingsEnabled="true" seems to be all that I have to do for this to work as it should. I was looking into an approach to reuse the Host header from HTTP request. In