Задайте вопросЗадайте вопрос
 

ОтвеченоMultiple Services with one implementation class

  • 4 июля 2009 г. 15:17Etowah_man Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     
    I have a two service contracts, call them IService1 and IService2 within the same file/namespace.

    I have one implementation class where I am trying to implement both of the services:

    public

     

    class Service1 : IService1, IService2

    {

     

    public string GetData(int value)

    {

     

    return string.Format("You entered: {0}", value);

    }
    ....

    I have added a second address/endpoint to my app.config file:

    <

     

    services>

    <

     

    service name="TestMultipleInterfaces.Service1" behaviorConfiguration="TestMultipleInterfaces.Service1Behavior">

    <

     

    host>

    <

     

    baseAddresses>

    <

     

    add baseAddress = "http://localhost:8731/Design_Time_Addresses/TestMultipleInterfaces/Service1/" />

    </

     

    baseAddresses>

    </

     

    host>

    <!--

     

    Service Endpoints -->

    <!--

     

    Unless fully qualified, address is relative to base address supplied above -->

    <

     

    endpoint address ="Rosey" binding="wsHttpBinding" contract="TestMultipleInterfaces.IService1">

    <

     

    identity>

    <

     

    dns value="localhost"/>

    </

     

    identity>

    </

     

    endpoint>

     

    <

     

    endpoint address ="TestManage" binding="wsHttpBinding" contract="TestMultipleInterfaces.IService2" >

    <

     

    identity>

    <

     

    dns value="localhost"/>

    </

     

    identity>

    </

     

    endpoint>

     

    <

     

    endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>

    </

     

    service>

    </

     

    services>

    What happens when I try to run this is that I get an error saying ' Cannot obtain Metadata from
    http://localhost:8731/Design_Time_Addresses/TestMultipleInterfaces/Service1/mex'

    I may be missing something simple here. Does this have to do with the addresses I have given my endpoints?

    Thanks!


    EM

Ответы

Все ответы