WCF가 기준을 높이거나 복잡성 수준을 높입니까?
WCF에서 제공하는 세 부분으로 구성된 서비스 / 호스트 / 클라이언트 모델의 가치를 이해합니다. 그러나 그것은 나뿐입니까, 아니면 WCF가 매우 직접적이고 직접적인 것을 취하여 (ASMX 모델) 엉망으로 만든 것처럼 보입니까?
SvcUtil의 명령 줄 단계를 사용하여 프록시를 생성하는 대안이 있습니까? ASMX 서비스를 통해 테스트 장치가 자동으로 제공되었습니다. 오늘 WCF에 좋은 대안이 있습니까?
WS * 항목이 WCF와 더 밀접하게 통합되어 있다는 점에 감사하고 WCF에 대한 보상을 찾을 수 있기를 바라지 만, 그렇지 않으면 당황합니다.
또한 WCF에서 사용할 수있는 책의 상태는 기껏해야 최악입니다. 뛰어난 저자 인 Juval Lowy는 훌륭한 O'Reilly 참고서 "Programming WCF Services"를 썼지 만 지금은 WCF를 사용하는 방법을 배우기 위해 그렇게 많이하지 않습니다. 그 책의 선구자 (그리고 조금 더 잘 정리되어 있지만 자습서로서 그다지 많지는 않음)는 Michele Leroux Bustamante의 Learning WCF입니다. 좋은 점이 있지만 구식이며 해당 웹 사이트가 사라졌습니다.
Google에 계속해서 bejebus를 계속하는 것 외에 좋은 WCF 학습 참조가 있습니까?
좋아, 간다. 먼저 Michele Leroux Bustamante의 책이 VS2008 용으로 업데이트되었습니다. 책의 웹 사이트가 사라지지 않았습니다. 지금 작동 중이며 훌륭한 WCF 정보가 많이 있습니다. 해당 웹 사이트에서 그녀는 책의 모든 예제에 대해 VS2008과 호환되는 업데이트 된 코드를 제공합니다. 아마존에서 주문하면 업데이트 된 재 인쇄물을 받게됩니다.
WCF는 ASMX를 대체 할 뿐만 아니라 물론 ASMX를 대체 할 수 있고 잘 작동하지만 실제 이점은 서비스를 자체 호스팅 할 수 있다는 것입니다. WSE의 대부분의 기능은 처음부터 구워졌습니다. 프레임 워크는 고도로 구성 가능하며 여러 프로토콜을 통해 여러 엔드 포인트를 제공하는 기능은 놀랍습니다. IMO입니다.
"서비스 참조 추가"옵션에서 프록시 클래스를 생성 할 수는 있지만 반드시 필요한 것은 아닙니다. 정말로해야 할 일은 ServiceContract 인터페이스를 복사하고 서비스에 대한 엔드 포인트를 찾을 위치를 코드에 알리는 것뿐입니다. 아주 적은 코드로 서비스에서 메서드를 호출 할 수 있습니다. 이 방법을 사용하면 구현을 완전히 제어 할 수 있습니다. 프록시 클래스를 생성하기 위해 선택한 방법에 관계없이 Michele은 주제에 대한 훌륭한 웹 캐스트 시리즈 에서 두 가지를 모두 보여주고 사용합니다 .
Michele은 엄청난 양의 훌륭한 자료를 가지고 있으며, 그녀의 웹 사이트를 확인하는 것이 좋습니다. 다음은 WCF를 배우면서 저에게 매우 도움이 된 몇 가지 링크입니다. WCF가 실제로 얼마나 강력한 지, 그리고 구현하기가 얼마나 쉬운 지 알게되기를 바랍니다. 학습 곡선은 약간 가파르지만 시간 투자에 대한 보상은 그만한 가치가 있습니다.
- Michele의 웹 캐스트 : http://www.dasblonde.net/2007/06/24/WCFWebcastSeries.aspx
- Michele의 책 웹 사이트 (VS2008에 대해 활성화 및 업데이트 됨) : http://www.thatindigogirl.com/
Michele의 웹 캐스트 중 하나 이상을 시청하는 것이 좋습니다. 그녀는 매우 효과적인 발표자이며 WCF와 관련하여 매우 지식이 풍부합니다. 그녀는 처음부터 WCF의 내부 작업을 이해하는 데 큰 역할을합니다.
저는 일반적으로 Google을 사용하여 WCF 답변을 찾고 다음 블로그에서 저를 찾습니다.
유용한 WCF 기사가있는 블로그
- http://blogs.msdn.com/drnick/default.aspx
- http://blogs.msdn.com/wenlong/default.aspx
- http://blogs.thinktecture.com/buddhike/
- http://www.dasblonde.net/default.aspx
내가 찾은 다른 귀중한 기사
- http://blogs.conchango.com/pauloreichert/archive/2007/02/22/WCF-Reliable-Sessions-Puzzle.aspx
- http://blogs.msdn.com/salvapatuel/archive/2007/04/25/why-using-is-bad-for-your-wcf-service-host.aspx
언제 WCF를 사용해야하는지 또는 언제 사용할지 알기가 어렵습니다. 왜? 생산성과 단순성을 제 목록 위에 두었 기 때문입니다. ASMX 모델이 왜 그렇게 성공적 이었습니까? 작동하고 빠르게 작동하기 때문입니다. 그리고 VS 2005 및 .NET 2.0에서 wsdl.exe는 상당히 훌륭하고 호환되는 서비스를 제공했습니다.
실제 생활에서는 아키텍처에 통신 프로토콜이 거의 없어야합니다. 이것은 유지 보수를 간단하게 유지합니다. 레거시 시스템에 액세스해야하는 경우 해당 시스템을위한 특정 어댑터를 작성하여 멋지고 아름다운 SOA 세계에서 함께 플레이 할 수 있습니다.
WCF는 ASMX보다 훨씬 강력하며 여러 가지 방법으로 확장됩니다. ASMX는 HTTP로만 제한되는 반면 WCF는 통신을 위해 여러 프로토콜을 사용할 수 있습니다 (허용되지만 HTTP는 여전히 상호 운용성이 필요한 서비스에 대해 대부분의 사람들이 사용하는 방식 임). WCF는 확장하기도 더 쉽습니다. 적어도 ASMX를 확장 할 수없는 방식으로 확장 할 수 있습니다. "쉬운"을 늘릴 수 있습니다. =)
제 생각에는 WCF에서 제공하는 추가 기능이 추가되는 복잡성보다 훨씬 큽니다. 또한 프로그래밍 모델이 더 쉽다고 생각합니다. DataContracts는 예를 들어 모든 것에 대한 공용 속성이있는 XML 직렬화를 사용하여 직렬화하는 것보다 훨씬 좋습니다. 또한 본질적으로 훨씬 더 선언적입니다.
잠깐 .... .NET Remoting을 사용한 적이 있습니까? 그게 진짜 대체품이기 때문입니다. .NET Remoting은 그 자체로 매우 복잡합니다. WCF가 더 쉽고 더 잘 배치되어 있습니다.
자주 언급되지는 않지만 ASMX 서비스와 매우 유사한 WCF를 사용하여 상당히 간단한 서비스를 구현할 수 있습니다. 예를 들면 :
[ServiceContract]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class SimpleService
{
[OperationContract]
public string HelloWorld()
{
return "Hello World";
}
}
web.config에 끝점을 등록해야하지만 그렇게 나쁘지는 않습니다.
Eliminating the verbosity of the separated data, service, and operation contracts goes a long way toward making WCF more manageable for me.
VS2008 includes the "Add Service Reference" context menu item which will create the proxy for you behind the scenes.
As was mentioned previously, WCF is not intended solely as a replacement for the ASMX web service types, but to provide a consistent, secure and scalable methodology for all interoperable services, whether it is over HTTP, tcp, named pipes or MSMQ transports.
I will confess that I do have other issues with WCF (e.g. re-writing method signatures when exposing a service over basicHTTP - see here, but overall I think it is a definite imrovement
If you're using VS2008 and create a WCF project then you automatically get a test harness when you hit run/debug and you can add a reference without having to use svcutil.
My initial thoughts of WCF were exactly the same! Here are some solutions:
- Program your own proxy/client layer utilising generics (see classes ClientBase, Binding). I've found this easy to get working, but hard to perfect.
- Use a third party implementation of 1 (SoftwareIsHardwork is my current favourite)
WCF is a replacement for all earlier web service technologies from Microsoft. It also does a lot more than what is traditionally considered as "web services".
WCF "web services" are part of a much broader spectrum of remote communication enabled through WCF. You will get a much higher degree of flexibility and portability doing things in WCF than through traditional ASMX because WCF is designed, from the ground up, to summarize all of the different distributed programming infrastructures offered by Microsoft. An endpoint in WCF can be communicated with just as easily over SOAP/XML as it can over TCP/binary and to change this medium is simply a configuration file mod. In theory, this reduces the amount of new code needed when porting or changing business needs, targets, etc.
ASMX is older than WCF, and anything ASMX can do so can WCF (and more)
. Basically you can see WCF as trying to logically group together all the different ways of getting two apps to communicate in the world of Microsoft; ASMX was just one of these many ways and so is now grouped under the WCF umbrella of capabilities.
Web Services can be accessed only over HTTP & it works in stateless environment, where WCF is flexible because its services can be hosted in different types of applications. Common scenarios for hosting WCF services are IIS,WAS, Self-hosting, Managed Windows Service.
The major difference is that Web Services Use XmlSerializer. But WCF Uses DataContractSerializer which is better in Performance as compared to XmlSerializer.
In what scenarios must WCF be used
- A secure service to process business transactions. A service that
- supplies current data to others, such as a traffic report or other
- monitoring service. A chat service that allows two people to
- communicate or exchange data in real time. A dashboard application
- that polls one or more services for data and presents it in a logical
- presentation. Exposing a workflow implemented using Windows Workflow
- Foundation as a WCF service. A Silverlight application to poll a
- service for the latest data feeds.
Features of WCF
- Service Orientation
- Interoperability
- Multiple Message Patterns
- Service Metadata
- Data Contracts
- Security
- Multiple Transports and Encodings
- Reliable and Queued Messages
- Durable Messages
- Transactions
- AJAX and REST Support
- Extensibility
source: main source of text
MSDN? I usually do pretty well with the Library reference itself, and I usually expect to find valuable articles there.
In terms of what it offers, I think the answer is compatibility. The ASMX services were pretty Microsofty. Not to say that they didn't try to be compatible with other consumers; but the model wasn't made to fit much besides ASP.NET web pages and some other custom Microsoft consumers. Whereas WCF, because of its architecture, allows your service to have very open-standard--based endpoints, e.g. REST, JSON, etc. in addition to the usual SOAP. Other people will probably have a much easier time consuming your WCF service than your ASMX one.
(This is all basically inferred from comparative MSDN reading, so someone who knows more should feel free to correct me.)
WCF should not be thought of as a replacement for ASMX. Judging at how it is positioned and how it is being used internally by Microsoft, it is really a fundamental architecture piece that is used for any type of cross-boundary communication.
I believe that WCF really advances ASMX web services implementation in many ways. First of all it provides a very nice layered object model that helps hide the intrinsic complexity of distributed applications. Secondly you can have more than request-replay messaging patterns, including asynchronous notifications from server to client (impossible with pure HTTP), and thirdly abstracting away the underlying transport protocol from XML messaging and thus elegantly supporting HTTP, HTTPS, TCP and other. Backward compatibility with "1-st generation" web services is also a plus. WCF uses XML standard as the internal representation format. This could be perceived as advantage or disadvantage, especially with the growing popularity "fat-free alternatives to XML" like JSON.
The difficult things I find with WCF is managing the configurations for clients and servers, and troubleshooting the not so nice faulted state exceptions.
It would be great if anyone had any shortcuts or tips for those.
I find that is a pain; in that I have .NET at both ends, have the same "contract" dlls loaded at both ends etc. But then I have to mess about with a lot of details like "KnownType" attributes.
WCF also defaults to only letting 1 or 2 clients connect to a service until you change lots of configuration. Changing the config from code is not easy, shipping lots of comfig files is not an option, as it is too hard to merge our changes into any changes a customer may have made at the time of an upgrade (also we don't want customers playing with WCF settings!)
.NET remoting tended to just work most of the time.
I think trying to pretend that .NET to .NET object based communications is the same as sending bit so of Text (xml) to an unknown system, was a step too far.
(The few times we have used WCF to talk to a Java system, we found that the XSD that the java system gave out did not match what XML it wanted anyway, so had to hand-code a lot of the XML mappings.)
참고URL : https://stackoverflow.com/questions/50114/does-wcf-raise-the-bar-or-just-the-complexity-level
'program story' 카테고리의 다른 글
자바 스크립트 함수 범위 지정 및 호이 스팅 (0) | 2020.09.19 |
---|---|
angular.js에서 HTML5 pushstate 사용 (0) | 2020.09.19 |
Intellij에서 Java 디버거를 사용할 때 "드롭 프레임"은 무엇을 의미합니까? (0) | 2020.09.19 |
JUnit 테스트는 Eclipse에서 통과하지만 Maven Surefire에서는 실패합니다. (0) | 2020.09.19 |
Html.Label, Html.LabelFor 및 Html.LabelForModel의 차이점은 무엇입니까? (0) | 2020.09.19 |