Investigating and Analyzing Applications - Discovering and Exposing an Service Bus Service
来源:互联网 发布:网络歌曲2006 编辑:程序博客网 时间:2024/06/09 14:35
The following topics describe how to use the Windows Azure Service Bus service registry to register service endpoints, expose them in the registry, publish WSDL metadata exchange endpoints, and locate service endpoints that have been registered to be publicly visible.
How to: Publish a Service to the Service Bus Registry
The ServiceRegistrySettings endpoint behavior gives you control over how a given service is published in the Service Registry. By default, all services are "cloaked" and are not visible in the Service Registry ATOM feed.
The following table lists the properties that you can set on the ServiceRegistrySettings endpoint:
DisplayName
This is the display name for the endpoint and is used as the <title>
field for the endpoint in the discovery ATOM feed. By default, the DisplayName property is set to the last segment of the service URI.
DiscoveryMode
This property is set to the Public or Private values, with the latter being the default. If you set this property toPublic, the endpoint is published into the Service Registry ATOM feed.
To add an Application to the Service Bus registry
Create an instance of the ServiceRegistrySettings behavior, using the Public parameter.
ServiceRegistrySettings serviceRegistrySettings = new ServiceRegistrySettings(DiscoveryType.Public);serviceRegistrySettings.DisplayName = "MyService";
Add the description to the associated endpoint.
foreach (ServiceEndpoint subscriberEndpoint in subscriberHost.Description.Endpoints){ subscriberEndpoint.Behaviors.Add(serviceRegistrySettings);}
Once a service has been deployed to a Windows Azure Service Bus endpoint, you can create a client to connect to that service. However, in order to do this, you must first know the URI of the service, which you can discover in one of two ways:
- The creator of the service can explicitly provide the URI.
- You can discover the address by navigating the naming hierarchy of the service namespace under which the service has been published.
This second step occurs through the service registry, which is a database of services and their associated URIs. exposing an endpoint in the service registry, see How to: Publish a Service to the Service Bus Registry.
To discover a service that has been published in the Service Registry
You can discover a published service by navigating the naming hierarchy, which can be accessed through a nested tree of Atom 1.0 feeds. Theroot feed for a given project is located at
http://<service-namespace>.servicebus.windows.net/
.Note that, by default, services are "cloaked," and not visible in the Atom feed. A developer must explicitly decide to make the service visible. However, cloaking only makes a serviceinvisible in the Atom feed; any client that has the necessary credentials can still connect to the service if it knows the address.
A Windows Azure Service Bus metadata endpoint is a URI that exposes additional information about a service or client application. For example, the Svcutil.exe tool uses the exposed metadata from a service to build a contract so that a developer can access that service. Without the metadata, the developer would have to gain access to the contract in some other way, such as asking the creator for a copy of it directly via e-mail. Note that you can still implement an interface without metadata: metadata just lets you easily obtain the contract if you do not already have it. Also note thatexposing a metadata endpoint differs frompublishing your interface to the ATOM feed: the metadata endpoint contains additional information about the contract, whereas publishing on the ATOM feed just lists the service URI in a publicly-accessed database.
The following is a simplified procedure for exposing metadata on an application that uses the Service Bus. For a complete discussion of metadata, see Metadata Architecture Overview in the Windows Communication Foundation (WCF) documentation.
To expose a metadata endpoint
In the App.config file for the host application, add the metadata endpoint definition to the service configuration information.
<services> <service name="Service.EchoService"> <endpoint name="RelayEndpoint" ... /> <endpoint name="MexEndpoint" contract="IMetadataExchange" binding="netTcpRelayBinding" bindingConfiguration="default" address="mex" /> </service></services>
To add metadata publishing to the service, modify the application configuration information to include an additional behavior section.
<system.serviceModel> ... <behaviors> <endpointBehaviors> ... <endpointBehaviors> <serviceBehaviors><behavior name="serviceMetadata"><serviceMetadata /></behavior></serviceBehaviors> </behaviors></system.serviceModel>
Add the metadata behavior to the service by specifying the
behaviorConfiguration
property in the service definition.<services> <service name="Service.EchoService" behaviorConfiguration="serviceMetadata"> ... </service></services>
Warning If the metadata endpoint is specified with a different end-to-end security mode than the service endpoint, and uses a relative address while sharing the same base address with the service endpoint, an exception of type System.ArgumentException is thrown when you open the service host. The following error message accompanies the exception: Incompatible channel listener settings. To resolve this issue, perform one of the following workarounds:- Specify the address of the metadata endpoint as a fully-qualified address.
- If you want to use a relative address for the metadata endpoint that shares a base address with the service endpoint, specify thesame end-to-end security mode for both the metadata and service endpoints.
- Use a relative address for the metadata endpoint with a base address that differs from the base address of the service endpoint.
- Specify the address of the metadata endpoint as a fully-qualified address.
- Investigating and Analyzing Applications - Discovering and Exposing an Service Bus Service
- Malware Forensics: Investigating and Analyzing Malicious Code
- Exposing a WCF Service With Multiple Bindings and Endpoints
- Exposing a new service via Oracle Service Bus
- Service and Service Composition
- Aqualogic Service Bus and Mule Flow Diagrame Comparation
- Windows Azure Service Bus - Bridge of Azure And Private Cloud
- Using JMS with Azure Service Bus and AMQP 1.0 (New)
- Wireless Quality of Service: Techniques, Standards, and Applications
- local service and remote service(AIDL Service)
- Creation of an Axis Web Service and a gSOAP client
- GridSAM an open-source job submission and monitoring web service
- use python and django make an web service
- wifi and socket and service
- Service and Binder(1)
- Service and Binder(2)
- Service and Binder(3)
- Service and Binder (4)
- Hibernate传播性持久化
- 从动车事故看互联网的产品开发和管理
- android activity之间的切换和传值
- MFC程序员的WTL指南系列 (WTL for MFC Programmers Series)
- 沉痛悼念张孝祥老师
- Investigating and Analyzing Applications - Discovering and Exposing an Service Bus Service
- ubuntu kgdb kernel 调试环境搭建
- 利用linux中iic子系统做IIC驱动
- 第六章堆排序之“堆排序HEAPSORT”
- 第二部分 核心动画基础---第三章 基础动画
- javaMail发送邮件(文本)
- B树
- Hibernate对象三种状态
- B树数据结构的实现