Problem in creating multiple endpoints in WCF?

Posted by Prabu_Spark under WCF on 2/13/2014 | Points: 10 | Views : 635 | Status : [Member] | Replies : 1
Hi sir,
I created wcf service to perform addition operation, its working fine in basichttp binding, i cant able to view that service in wshttp binding. I tested the wcf service using wcftestclient utility, it is showing only basic httpbinding. I attached the service and web.config for your reference. Kindly check the code and tell me the solution for this problem.


Service.cs
****************

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
public class Service : IService
{
public int Add(int a,int b)
{
return a + b;
}
}


IService.cs
***************

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
[ServiceContract]
public interface IService
{
[OperationContract]
int Add(int a, int b);
}


Web.config:
**************

<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>
</system.web>
<system.serviceModel>
<services>
<service name="ArithmeticService.Service">

<host>

<baseAddresses>
<add baseAddress="http://localhost:1234/arithmetics" />
</baseAddresses>
</host>
<endpoint address="ws" binding="wsHttpBinding" contract="ArithmeticService.IService"/>
<endpoint address="basic" binding="basicHttpBinding" contract="ArithmeticService.IService"/>

<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>

With regards,
J.Prabu.
[Email:prbspark@gmail.com]



Responses

Posted by: Sravan661 on: 2/14/2014 [Member] Bronze | Points: 25

Up
0
Down
Hi,
Please specify name to the bindings in web.comfig and try again
Reference :
http://msdn.microsoft.com/en-us/library/ms751515%28v=vs.110%29.aspx

Hope it helps you
Mark as answer if satisfied

sravan

Prabu_Spark, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response