使WCF易于配置WCF

2023-09-03 10:54:17 作者:心淡然っ

我有一组WCF Web服务连接到通过动态的桌面应用程序。

I have a set of WCF web services connected to dynamically by a desktop application.

我的问题是真正详细的配置设置,WCF需要工作。获取SSL工作涉及到自定义设置。获取MTOM或其他任何工作需要更多。你想COM pression?在这里,我们又来了......

My problem is the really detailed config settings that WCF requires to work. Getting SSL to work involves custom settings. Getting MTOM or anything else to work requires more. You want compression? Here we go again...

WCF真的很强大 - 您可以使用许多不同的方式来连接,但似乎都涉及到大量的详细配置的。如果主机和客户端不完美匹配你很难破译错误。

WCF is really powerful - you can use a host of different ways to connect, but all seem to involve lots of detailed config. If host and client don't match perfectly you get hard to decipher errors.

我想使桌面应用程序易于配置 - 理想的某种自动发现。桌面应用程序的用户应该只能够输入URL,并将其做休息。

I want to make the desktop app far easier to configure - ideally some kind of auto-discovery. The users of the desktop app should just be able to enter the URL and it do the rest.

有谁知道一个好办法做到这一点?

Does anyone know a good way to do this?

我知道Visual Studio中可以设置的配置为你,但我想在桌面应用程序,能够根据各种不同的服务器设置窗口中做到这一点。

I know Visual Studio can set the config up for you, but I want the desktop app to be able to do it based on a wide variety of different server set-ups.

我知道VS的工具,可以在外部使用,但我正在寻找的桌面应用程序的用户不必是WCF专家。我知道MS做出这一有意在复杂的。

I know that VS's tools can be used externally, but I'm looking for users of the desktop apps to not have to be WCF experts. I know MS made this intentionally over complicated.

有什么办法,机制,第三方库或任何使自动发现WCF的设置可能吗?

Is there any way, mechanism, 3rd party library or anything to make auto-discovery of WCF settings possible?

推荐答案

有关端点的所有信息可在服务的元数据,你可以写一个客户端是什么将探索服务的元数据,并配置客户端。对于code例如你可以看看这个优秀的墨西哥资源管理器从Juval洛伊的。

All information about the endpoint is available in metadata of a service, you can write a client what will explore the meta data of the service and will configure the client. For a code example you can look into this excellent Mex Explorer from Juval Lowy.