wcf-configuration

WCF Service exception error when try to host in ASP.NET Web Site

随声附和 提交于 2019-12-10 10:13:42
问题 The following error occurs when trying to browse my .svc file. An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is: System.NullReferenceException: Object reference not set to an instance of an object. at System.ServiceModel.Description.WsdlExporter.CreateWsdlBindingAndPort(ServiceEndpoint endpoint, XmlQualifiedName wsdlServiceQName, Port& wsdlPort, Boolean& newBinding, Boolean& bindingNameWasUniquified) at System.ServiceModel.Description.WsdlExporter

Webservice returns wrong content-type response header

孤者浪人 提交于 2019-12-08 12:28:49
问题 I am trying to use third-party web service (php-based) in asp.net c# application, and failed with service configuration.Already tried add service/web reference - all the same error : The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 402 bytes of the response were: '<?xml version="1.0" encoding="utf-8"?><soap

Transform appSettings from external file after merge

做~自己de王妃 提交于 2019-12-07 12:44:26
问题 What I'm trying to do is transform one of appSettings which is in external file: Here is external.config <?xml version="1.0"?> <appSettings> <add key="SomeKey" value="some value" /> </appSettings> Web.config <?xml version="1.0"?> <configuration> <appSettings file="..\..\external.config"> <add key="SomeKey1" value="some value 1" /> </appSettings> </configuration> Web.Debug.config <?xml version="1.0"?> <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <appSettings>

Can everything be done programmatically in WCF or are configuration files for certain features?

廉价感情. 提交于 2019-12-07 11:06:47
问题 I have a strong preference for working in code, leverage IntelliSense and opening up all of the power of the C# language to work with WCF but I want to make sure that I'm not moving in a direction that ultimately will limit the WCF feature set I can access. My experience is so limited with WCF that I don't understand the benefits of using the configuration files, especially if you can do everything in code (?). Note: I'm using .NET 3.5. Can you do 'everything' with WCF programmatically or are

Transform appSettings from external file after merge

霸气de小男生 提交于 2019-12-05 19:50:40
What I'm trying to do is transform one of appSettings which is in external file: Here is external.config <?xml version="1.0"?> <appSettings> <add key="SomeKey" value="some value" /> </appSettings> Web.config <?xml version="1.0"?> <configuration> <appSettings file="..\..\external.config"> <add key="SomeKey1" value="some value 1" /> </appSettings> </configuration> Web.Debug.config <?xml version="1.0"?> <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <appSettings> <add key="SomeKey" value="some changed value"xdt:Transform="SetAttributes" xdt:Locator="Match(key)"/>

How to add maxItemsInObjectGraph programmatically without using configuration file?

好久不见. 提交于 2019-12-05 17:13:52
问题 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> 回答1: On the server you have to add it in the ServiceBehavior Attribute: [ServiceBehavior

Can everything be done programmatically in WCF or are configuration files for certain features?

霸气de小男生 提交于 2019-12-05 16:01:33
I have a strong preference for working in code, leverage IntelliSense and opening up all of the power of the C# language to work with WCF but I want to make sure that I'm not moving in a direction that ultimately will limit the WCF feature set I can access. My experience is so limited with WCF that I don't understand the benefits of using the configuration files, especially if you can do everything in code (?). Note: I'm using .NET 3.5. Can you do 'everything' with WCF programmatically or are configuration files required for the full WCF feature set? marc_s You can do about 99.8% of things in

WCF MaxItemsInObjectGraph setting not working

安稳与你 提交于 2019-12-04 11:13:05
问题 I have been getting the following error trying to access my WCF service. 'Maximum number of items that can be serialized or deserialized in an object graph is '65536'. Change the object graph or increase the MaxItemsInObjectGraph quota Doing some research, it looks like all I need to do is update this setting to be a higher value. This is what I am trying to do, but the setting does not seem to be getting read from the configuration. I keep getting the same exception with the 65536 value in

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

netTCP binding Soap Security Negotiation Failed

北城以北 提交于 2019-12-04 00:36:34
I am writing a WCF service requires impersonate and session. It is ok when I tried to call it on my local machine, but on the remote machine it always failed with such error: Security Support Provider Interface (SSPI) authentication failed. The server may not be running in an account with identity 'host/hostname'. If the server is running in a service account (Network Service for example), specify the account's ServicePrincipalName as the identity in the EndpointAddress for the server. If the server is running in a user account, specify the account's UserPrincipalName as the identity in the