English 中文(简体)
ServiceContractGenerator vs ServiceDescriptionImporter
原标题:

I m trying to build a light-weight SOAP client without using Add Service Reference. Ideally, this client should work for as many services as possible. Currently, it uses ServiceDescriptionImporter to generate the service assembly. Unfortunately, this doesn t appear to work for WCF services. Someone recommended that I use ServiceContractGenerator instead, because ServiceDescriptionImporter is designed specifically for ASMX web services.

If I use ServiceContractGenerator, will I be locked into only supporting WCF services?

最佳回答

ServiceDescriptionImporter is the class that is used by the "Add Web Reference" dialog in VS and the "wsdl.exe" tool in the SDK to generate "asmx"-style client web service proxies. ServiceContractGenerator is the WCF equivalent, for the "Add Service Reference" dialog in VS and the "svcutil.exe" tool in the SDK. The former uses the asmx client infrastructure (System.Web.Services.Protocols.SoapHttpClientProtocol and friends) and the latter uses the WCF client infrastructure (System.ServiceModel.ClientBase and friends).

Either will be able to talk to most services -- that is, it is intended for both the WCF and asmx client infrastructures to be broadly interoperable with a range of web services standards. A WCF client can talk to an asmx server (as well as servers from other vendors) and vice versa.

That said, WCF is newer, richer, better supported, and supports more WS standards than does asmx. You will certainly not be locked into only supporting WCF services.

问题回答

暂无回答




相关问题
Run EXE from client side

I need run an exe file from client side. The Exe file exist in my C: Directory. I need run this exe file from my WEB site. How can I co this?

Security in PHP

I ve written some PHP scripts to do some server-side work on a headless linux server machine on a LAN. For example, I have http://ipadress/php/operations.php?operation=registerUser&uName=X&...

EMAIL server FSP model

For my assignment I need to develop FSP model for email server and client. I manage to write simple model which describes one user, server and his mailbox, but I am having problems changing this ...

Calling a service from a callback method in Client

I have a scenario where, upon receiving a command on one of the callback methods in client, the client needs to call another service. For example: In OnNewCommand() callback method client receives a ...

ServiceContractGenerator vs ServiceDescriptionImporter

I m trying to build a light-weight SOAP client without using Add Service Reference. Ideally, this client should work for as many services as possible. Currently, it uses ServiceDescriptionImporter to ...

Simple server and client request/response in C#

OK. I just want to know if this can be done. I m using C# asp.net language. I want to send a structure to a webserver from a webpage (much like you you can pass a structure to a function). The ...

热门标签