Click here to Skip to main content
15,888,337 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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<br />

2.
public interface ISiteGateway:IBasicSite<br />

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:

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

And The SiteGateway look like this:
C#
[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:
XML
<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:
BasicSiteClient bs = new BasicSiteClient();
bs.GotoPreset();
at the client2 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.
Posted

1 solution

This could be caused by maxBufferSize and/or maxReceivedMessageSize being exceeded. You may want to try increasing them in your binding configuration settings.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900