views:

8

answers:

0

Hi, I want to create service that contains two binding and two contracts. The binding are: 1. wsDualHttpBinding 2. wsHttpBinding

I get two interfaces:

  1. public interface IBasicSite
  2. public interface ISiteGateway:IBasicSite

The difference between IBasicSite and ISiteGateway is only that ISiteGateway support also Callback's that called ISiteGatewayCallback. They both use same DataContracts. The classes are looking like this:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Single)]
    public class BasicSite : IBasicSite
{
...
}

And The SiteGateway look like this:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Single)]public class SiteGateway : BasicSite, ISiteGateway
{
      List<ISiteGatewayCallback> callbackList = new List<ISiteGatewayCallback&gt;();
...
}

My problem is how to configure the service. this is my configuration for now:

<services>
 <service behaviorConfiguration="WcfService.SiteGatewayBehavior"
  name="WcfService.SiteGateway">
  <clear />
  <endpoint address="http://localhost:1189/SiteGateway" binding="wsDualHttpBinding"
   bindingConfiguration="" contract="WcfService.ISiteGateway">
   <identity>
    <dns value="localhost" />
    <certificateReference storeName="My" storeLocation="LocalMachine"
     x509FindType="FindBySubjectDistinguishedName" />
   </identity>
  </endpoint>
  <endpoint address="http://localhost:1189/BasicSite" binding="wsHttpBinding"
   bindingConfiguration="" contract="WcfService.IBasicSite" />
  <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"
   listenUriMode="Explicit">
   <identity>
    <dns value="localhost" />
    <certificateReference storeName="My" storeLocation="LocalMachine"
     x509FindType="FindBySubjectDistinguishedName" />
   </identity>
  </endpoint>
 </service>
</services

The client is able the see the two binding and create the methods by WSDL but when i use them i get an exception. My problems are:

  1. The client get an exception when ever he try to call invoke. For example when ever i use this code at the client:

    BasicSiteClient bs = new BasicSiteClient();

    bs.GotoPreset();

at the client i get this exception:"An error occurred while receiving the HTTP response to http://localhost:1189/BasicSite. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details." when ever the client try to call a method.

2.I need that the DataContract will be the same for the two different binding will be the same because its the same class the contain only data objects.

What am i doing wrong and how should i solve this problems?

Thanks,

Shai.