יום שישי, 24 במאי 2013

Discovery service name and namespace

Setting the name and the namespace of a WCF service for discovery announcement can be done using the ServiceContract attribute properties
For an example:
[ServiceContract(Namespace=@"Com.myCompany.Services",Name="IMyServiceAlias"
)]
public interface IMyService

The change can be seen using Wireshark
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header>
<a:Action s:mustUnderstand="1">http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/Hello</a:Action>
<h:AppSequence InstanceId="1369239226" MessageNumber="1" xmlns:h="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01"/>
<a:MessageID>urn:uuid:bc95d269-a20f-4d7b-b5bd-c31698dd9569</a:MessageID>
<a:To s:mustUnderstand="1">urn:docs-oasis-open-org:ws-dd:ns:discovery:2009:01</a:To>
</s:Header>
<s:Body>
<Hello xmlns="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01">
<a:EndpointReference>
<a:Address>http://localhost:8989/myService</a:Address>
</a:EndpointReference>
<d:Types xmlns:d="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01" xmlns:dp0="Com.myCompany.Services">dp0:IMyServiceAlias</d:Types>
<XAddrs>http://localhost:8989/myService</XAddrs>
<MetadataVersion>0</MetadataVersion>
</Hello>
</s:Body>
</s:Envelope>

אין תגובות:

הוסף רשומת תגובה