wcf-4

Flat WSDL for WCF 4 Service

陌路散爱 提交于 2019-12-30 01:30:05
问题 Using WCF 3.5 and the FlatWsdl EndpointBehavior from Christian Weyer, I was able to get a single flat WSDL file for my WCF services without any <import> directives. Now with WCF 4, this doesn't work anymore for some reason. I have tried everything described in a lot of blog entries including using the WcfExtras behavior extension. They all either refer to Chr. Weyers solution or recommend the WcfExtras. I also made sure I specified the same namespace for the binding, ServiceContract and

Web service call returns 405 method not allowed error

南楼画角 提交于 2019-12-24 01:27:29
问题 I currently have a deployed wcf application on iis 7.5, windows server 2008 R2. I am using a asp 4.0 mvc which calls the different methods of the wcf web service application. When I make an ajax GET request to any method in the wcf application I get the expected json result and all works fine. However, when I make a POST request I get the 405 method not allowed error. I checked the "Handle Mappings" in iis and all the .svc mappings allow ALL Verbs. 1. My svc-ISAPI is mapped to aspnet_isapi

Correct way to close WCF 4 channels effectively

怎甘沉沦 提交于 2019-12-21 03:46:11
问题 I am using the following ways to close the WCF 4 channels. Is this right way to do it? using (IService channel = CustomChannelFactory<IService>.CreateConfigurationChannel()) { channel.Open(); //do stuff }// channels disposes off?? 回答1: Although not strictly directed at the channel, you can do: ChannelFactory<IMyService> channelFactory = null; try { channelFactory = new ChannelFactory<IMyService>(); channelFactory.Open(); // Do work... channelFactory.Close(); } catch (CommunicationException) {

Correct way to close WCF 4 channels effectively

*爱你&永不变心* 提交于 2019-12-21 03:46:06
问题 I am using the following ways to close the WCF 4 channels. Is this right way to do it? using (IService channel = CustomChannelFactory<IService>.CreateConfigurationChannel()) { channel.Open(); //do stuff }// channels disposes off?? 回答1: Although not strictly directed at the channel, you can do: ChannelFactory<IMyService> channelFactory = null; try { channelFactory = new ChannelFactory<IMyService>(); channelFactory.Open(); // Do work... channelFactory.Close(); } catch (CommunicationException) {

Custom “Basic” Authentication for my WCF services. REST and RIA. Possible?

时光怂恿深爱的人放手 提交于 2019-12-12 01:26:28
问题 My server side contains WCF4 REST services and I'm going to add RIA services for my future SL4 application. Currently I'm doing Basic authentication like this: var auth = HttpContext.Current.Request.Headers.GetValues("Authorization"); And so on.. You get the idea.. I call this on every request. If header not present or I can't validate UN/Password - I do this: outgoingResponse.Headers.Add("WWW-Authenticate: Basic realm=\"Secure Area\""); That got me by so far but I'm refactoring my server

Autofac + WCF REST 4.0

旧城冷巷雨未停 提交于 2019-12-11 06:51:30
问题 I am building a WCF 4.0 REST service and want to use Autofac as DI container. Apparently, I want to be able to call a parameterized constructor of the service class (service contract implementation), which accepts a bunch of interfaces to work with. Those interfaces are to be registered within Autofac container and I want them resolved and used when creating an instance of my service class (instead of calling not parameterized constructor, which is default). There is similar problem with MVC

Basic HTTP Binding isn't configured properly

*爱你&永不变心* 提交于 2019-12-09 13:11:23
问题 i have configured a WCF service with wsHTTPBinding but even then i get the error Contract requires Session, but Binding 'BasicHttpBinding' doesn't support it or isn't configured properly to support it. here is the service contract definition <ServiceContract(SessionMode:=SessionMode.Required)> Public Interface IPrivateService Here is the service implementation definition <ServiceBehavior(InstanceContextMode:=InstanceContextMode.PerSession)> Public Class PrivateService Implements

Create flattened WSDL using svcutil for wcf 4

我的梦境 提交于 2019-12-08 05:03:01
问题 I need to create a wsdl without the extras xsd files as external files, but have them all inside a single file. I need this because they will be imported by Delphi's WSDL importer, that is quite out-of-date. Can I do this using svcutil.exe? If it's not possible with svcutil, is there any way to do this? I have seen very old samples, based on WCF 3.5, but I don't know if they still apply. Tks so much 回答1: This seems to be a popular topic this week. There are several articles on how to generate

Duplex channel Faulted event does not rise on second connection attempt

血红的双手。 提交于 2019-12-06 11:39:22
问题 I have regular net.tcp WCF service client, and regular net.tcp duplex (i.e. with a callback) WCF service client. I have implemented some logic to constantly reinstantiate the connection in case a service has faulted. They are created in the exactly same way: FooServiceClient Create() { var client = new FooServiceClient(ChannelBinding); client.Faulted += this.FaultedHandler; client.Ping(); // An empty service function to make sure connection is OK return client; } BarServiceClient Create() {

Duplex channel Faulted event does not rise on second connection attempt

左心房为你撑大大i 提交于 2019-12-04 17:09:29
I have regular net.tcp WCF service client, and regular net.tcp duplex (i.e. with a callback) WCF service client. I have implemented some logic to constantly reinstantiate the connection in case a service has faulted. They are created in the exactly same way: FooServiceClient Create() { var client = new FooServiceClient(ChannelBinding); client.Faulted += this.FaultedHandler; client.Ping(); // An empty service function to make sure connection is OK return client; } BarServiceClient Create() { var duplexClient = new BarServiceClient(new InstanceContext(this.barServiceCallback)); duplexClient