【发布时间】:2012-12-05 01:44:00
【问题描述】:
我有一个使用 AppFabric 自动启动的 svc。我想做的是expose the wsdl for my service over the bus。当然,在内部服务和 wsdl 工作正常,我也可以毫无问题地通过总线使用服务。我唯一不能正确配置的是通过中继查看 wsdl。
ServiceHostFactory 创建默认端点,并添加一个 Azure 端点和一个 mex 端点,希望通过中继公开 wsdl。当我尝试从服务总线 url 查看 wsdl 时,出现不匹配错误,可能是由于 ACS 身份验证失败?
...cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree
我是否需要将 mex 端点设置为匿名身份验证,以便我可以转到浏览器并查看 wsdl?只是不知道还有什么可以尝试...任何帮助将不胜感激!
示例网址:
http://myservicebusexample.servicebus.windows.net/MyService/AService.svc?wsdl
或
http://myservicebusexample.servicebus.windows.net/MyService/AService.svc/mex
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
这是我的ServiceHostFactory
// Create host with default endpoints
ServiceHost host = new ServiceHost(serviceType, baseAddresses);
host.AddDefaultEndpoints();
// Create Relay Endpoint for Azure
ServiceEndpoint relayEndpoint = host.AddServiceEndpoint(typeof(IMyContract), new BasicHttpRelayBinding("MyAzureBindingConfiguration"), relayAddress);
// Apply ACS Credentials for the relay endpoint
relayEndpoint.ApplyEndpointBehaviorConfig("MyAzureACSCredentials");
// Create mex Endpoint to expose wsdl over the relay
ServiceEndpoint mexEndpoint = host.AddServiceEndpoint(ServiceMetadataBehavior.MexContractName,
new BasicHttpRelayBinding("MyAzureBindingConfiguration"),
"mex");
// Apply ACS Credentials for the mex endpoint
mexEndpoint.ApplyEndpointBehaviorConfig("MyAzureACSCredentials");
【问题讨论】:
-
Gabe - 你都明白了吗?我有一个 netTcpRelay 绑定,我正在尝试使用 basicHttpRelay 和 netTcpRelay 公开元数据,但都没有成功。
-
不,从来没有找到解决办法。我最终不得不为消费者创建一个服务代理。
标签: azure wsdl azureservicebus basichttprelaybinding