通过Azure在BasicHttpRelayBinding上公开WSDL [英] Exposing WSDL on BasicHttpRelayBinding over Azure

查看:85
本文介绍了通过Azure在BasicHttpRelayBinding上公开WSDL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用AppFabric自动启动的svc.我想做的是通过总线公开用于我的服务的wsdl .在内部,服务和wsdl当然可以正常工作,我也可以通过总线使用该服务,而不会出现任何问题.我唯一无法正确配置的就是通过中继查看wsdl.

I have an svc that is auto-started using AppFabric. What I want to do is expose the wsdl for my service over the bus. Internally the service and the wsdl work fine of course, I can also consume the service over the bus with no issue. The only thing I can't configure properly is viewing the wsdl over the relay.

ServiceHostFactory创建默认终结点,并添加一个Azure终结点和一个mex终结点,以期在中继上公开wsdl.当我尝试从服务总线URL查看wsdl时,出现了不匹配错误,可能是由于ACS身份验证失败?

The ServiceHostFactory creates default endpoints and also adds an Azure Endpoint along with a mex endpoint in hopes to expose the wsdl over the relay. When I try to view the wsdl from the service bus url, I get the mismatch fault, probably due to ACS authentication failing?

...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?只是不确定还有什么尝试...任何帮助将不胜感激!

Do I need to set the mex endpoint up as anonymous authentication so I can go to a browser and view the wsdl? Just not sure what else to try... Any help would be appreciated!

示例网址:

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");

推荐答案

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

Try adding the serviceBehavior which enables the metadata behavior:

 <behavior>
    <serviceMetadata />
 </behavior>

这篇关于通过Azure在BasicHttpRelayBinding上公开WSDL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆