【问题标题】:Exposing WSDL on BasicHttpRelayBinding over Azure通过 Azure 在 BasicHttpRelayBinding 上公开 WSDL
【发布时间】: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


【解决方案1】:

尝试添加启用元数据行为的 serviceBehavior:

 <behavior>
    <serviceMetadata />
 </behavior>

【讨论】:

  • 我应该在问题中指出我确实有这个问题。感谢您的尝试,非常感谢。
  • 您可以尝试将 ?wsdl 更改为 /mex - 像这样:http://....windows.net/MyService/AService.svc/mex
  • 也试过了,结果一样
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-11-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-12-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多