wcf

Which WCF configuration approach is smarter?

扶醉桌前 提交于 2020-01-24 04:17:10
问题 Im reading 2 books about WCf and one of them is showing Configuration as App.Config and the other is showing via Code in C# I want to know which approach should i use and what are the benefits for each other. Does the Wcf Configuration Wizard supports also the c# code behind configuration ? thanks for the answers. 回答1: I guess it depends on your needs. I personally tend to configure wcf with code, especially for things that are unlikely to ever change. That might include error handlers/logger

WCF service connection with third party dll with IIS

試著忘記壹切 提交于 2020-01-24 04:02:05
问题 I am working with Windows 7, VS2010, SqlServer 2008. My application takes data form a third party dll (which takes data from another process that must be running in the background) and processes the data and send it over a WCF service to the front end. The application is done and does what it supposed to do. Now when I want to distribute it and Run it in IIS. I am facing a strange problem. The application get the data from a dll when I run it in IIS it fails and gives an error while

Pros and Cons of wcf config file vs in code config

人盡茶涼 提交于 2020-01-24 02:19:48
问题 I have a self hosted C# WCF service which creates 20+ endpoints for various purposes. Each is configured in the code itself with a few basic config items in the app.config of the service such as port and address. The service works great for the tested clients, but has not been widely tested. I was a little leary of the standard wcf config file approach because I was afraid the end user would mess things up and hence did everything in code. Is it a better idea to do the configuration in the

The url in json contains backslashes

跟風遠走 提交于 2020-01-23 17:27:12
问题 I was just wondering why my wcf rest returns json which contains backslahses in the url. it is as below: https:\/\/s3.amazonaws.com\/reiaustralia\/1fc00dfab25044ecb31e4882121b535e\/jpg\/download.jpg?AWSAccessKeyId=AKIAISTDESL6TBRAVM4Q&Expires=1380692091&Signature=MduuaUAjQRisadtM%2FDuVDemexLY%3D Thanks 回答1: Forward slashes can be escaped with a backslash in JSON, but they don't have to be. So either one of the following: {"url":"http://www.example.com/"} or {"url":"http\/\/www.example.com\/"}

WCF, async, and a confusion of context

◇◆丶佛笑我妖孽 提交于 2020-01-23 13:49:31
问题 Well, I was going to name this and a question of context , but apparently the word question isn't allowed in titles. Anyway, here's the issue: I use IErrorHandler in my WCF services in order to provide logging without cluttering up all of my service code. Until now, this has worked great. However, now that I'm trying to move to completely asynchronous services, I'm encountering the issue of the call stack being a return stack instead of a causality chain. Now, I tried using Stephen Cleary's

How to convert a WCF service from SOAP to REST?

纵饮孤独 提交于 2020-01-23 12:27:10
问题 I am very new to WCF and I have questions about it. After going through some articles I found that in the web.config file if I change the endpoint binding to webHttpBinding from basicHttpBinding and httpGetEnabled from true to false it uses REST. My question is are these the only two things that I need to change to make a service SOAP or REST? Or do I need to change/add any other things? 回答1: You can expose the service in two different endpoints. the SOAP one can use the binding that support

How do I use WCF reference with MVC3 (razor) model?

微笑、不失礼 提交于 2020-01-23 12:06:28
问题 I have a WCF Service and a MVC3 (razor) web site. All my data comes from the WCF Service . I have my controllers and views but, how do I use the model with this structure ? for now, I call my method from the service with a DataController and I called them in the Controllers.. Better solution ? 回答1: Do you want to access a WCF service from your Model? Ouch... Stick to the Controller. Controllers interact with services, models don't. 回答2: 1.You created web reference to your service - and

How do I use WCF reference with MVC3 (razor) model?

依然范特西╮ 提交于 2020-01-23 12:05:47
问题 I have a WCF Service and a MVC3 (razor) web site. All my data comes from the WCF Service . I have my controllers and views but, how do I use the model with this structure ? for now, I call my method from the service with a DataController and I called them in the Controllers.. Better solution ? 回答1: Do you want to access a WCF service from your Model? Ouch... Stick to the Controller. Controllers interact with services, models don't. 回答2: 1.You created web reference to your service - and

Entity framework data contract

醉酒当歌 提交于 2020-01-23 10:46:48
问题 I am new to WCF and Entity framework. I have a class library "A" which contains DatabaseEntities.edmx (Entity Framework objectContext ). This library is exposing a class "B" which contains a function FunctionB , internally using the entity objects. I have taken this library "A" reference into a WCF web service and inside the IService.cs - I have coded it like this: [OperationContract] void FunctionB_Proxy(); Without defining any DataContract I have gone into Service1.cs and implemented this

Entity framework data contract

做~自己de王妃 提交于 2020-01-23 10:46:12
问题 I am new to WCF and Entity framework. I have a class library "A" which contains DatabaseEntities.edmx (Entity Framework objectContext ). This library is exposing a class "B" which contains a function FunctionB , internally using the entity objects. I have taken this library "A" reference into a WCF web service and inside the IService.cs - I have coded it like this: [OperationContract] void FunctionB_Proxy(); Without defining any DataContract I have gone into Service1.cs and implemented this